2 pc luckyboy pc_luckyboy 于 2014.04.08 21:15 提问

CLR工程,using Microsoft.Office.Interop.Excel后编译报错

目的:用VS2008创建CLR窗体工程后,需要导出数据到Excel

添加microsoft excel 11.0 object library后,代码里面写入using Microsoft.Office.Interop.Excel,编译就报错,非常的怪异。

哪位大虾帮忙看看什么原因?谢谢!

.\selectdemo.cpp(12) : error C2872: 'Application' : ambiguous symbol
1> could be 'c:\program files\microsoft visual studio 9.0\visual studio tools for office\pia\office12\microsoft.office.interop.excel.dll : Microsoft::Office::Interop::Excel::Application'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::Application'
1>.\selectdemo.cpp(12) : error C2039: 'EnableVisualStyles' : is not a member of 'Microsoft::Office::Interop::Excel::Application'
1> c:\program files\microsoft visual studio 9.0\visual studio tools for office\pia\office12\microsoft.office.interop.excel.dll : see declaration of 'Microsoft::Office::Interop::Excel::Application'
1>.\selectdemo.cpp(12) : error C3861: 'EnableVisualStyles': identifier not found
1>.\selectdemo.cpp(13) : error C2872: 'Application' : ambiguous symbol
1> could be 'c:\program files\microsoft visual studio 9.0\visual studio tools for office\pia\office12\microsoft.office.interop.excel.dll : Microsoft::Office::Interop::Excel::Application'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::Application'
1>.\selectdemo.cpp(13) : error C2039: 'SetCompatibleTextRenderingDefault' : is not a member of 'Microsoft::Office::Interop::Excel::Application'
1> c:\program files\microsoft visual studio 9.0\visual studio tools for office\pia\office12\microsoft.office.interop.excel.dll : see declaration of 'Microsoft::Office::Interop::Excel::Application'
1>.\selectdemo.cpp(13) : error C3861: 'SetCompatibleTextRenderingDefault': identifier not found
1>.\selectdemo.cpp(16) : error C2872: 'Application' : ambiguous symbol
1> could be 'c:\program files\microsoft visual studio 9.0\visual studio tools for office\pia\office12\microsoft.office.interop.excel.dll : Microsoft::Office::Interop::Excel::Application'
1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::Application'

1>.\selectdemo.cpp(16) : error C2660: 'Microsoft::Office::Interop::Excel::_Application::Run' : function does not take 1 arguments

1个回答

u014165208
u014165208   2014.04.09 11:33

  成龙六十寿宴现身。  先说片酬,成龙自己曾说,到好莱坞拍片,最大的回馈,就是在那里“分红分到手软”,健全的红利制度让他乐不思蜀。他曾坦言,他1个月的收入,更是人家1年的收入。现在估计只会更多。  再说房产。成龙最名贵的房产,要算是在美国洛杉矶比佛利山庄的豪宅。此外,对房地产颇有兴趣的成龙在澳洲悉尼、吉隆坡、新加坡等地都有房地产十几栋。  还有汽车和飞机。成龙还拥有约30辆价值千万元的跑车。除此之外,成龙还有价值近2亿元人民币的私人飞机。最牛的还是成龙的收藏爱好。成龙这几年收集了7间徽派古屋、2间亭楼。前几年他决定将7间古屋,自己留下1间之外其余6间全部捐出,总价值过亿。   http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082773  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082772  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082771  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082770  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082769  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082767  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082768  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082765  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082766  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082764  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082762  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082763  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082761  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082760  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082759  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082758  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082757  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082756  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082755  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082754  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082752  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082753  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082751  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082750  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082748  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082749  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082747  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082746  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082744  http://www.kuaipan.cn/index.php?ac=file&oid=239021406833082745  http://www.rayfile.com/zh-cn/files/aabb2905-bf84-11e3-8345-0015c55db73d/  http://www.rayfile.com/zh-cn/files/b632e98f-bf84-11e3-b928-0015c55db73d/  http://www.rayfile.com/zh-cn/files/c37fceb8-bf84-11e3-ada3-0015c55db73d/  http://www.rayfile.com/zh-cn/files/c7929dde-bf84-11e3-ade8-0015c55db73d/  http://www.rayfile.com/zh-cn/files/ce8c1d17-bf84-11e3-ba02-0015c55db73d/  http://www.rayfile.com/zh-cn/files/d1711e8f-bf84-11e3-b768-0015c55db73d/  http://www.rayfile.com/zh-cn/files/d358dfca-bf84-11e3-bb42-0015c55db73d/  http://www.rayfile.com/zh-cn/files/d4c8a0f0-bf84-11e3-84f8-0015c55db73d/  http://www.rayfile.com/zh-cn/files/d81b336e-bf84-11e3-ab0a-0015c55db73d/  http://www.rayfile.com/zh-cn/files/d94759e8-bf84-11e3-b9be-0015c55db73d/  http://www.rayfile.com/zh-cn/files/e023b20c-bf84-11e3-98cc-0015c55db73d/  http://www.rayfile.com/zh-cn/files/e223eff3-bf84-11e3-9488-0015c55db73d/  http://www.rayfile.com/zh-cn/files/e3e05a07-bf84-11e3-93dd-0015c55db73d/  http://www.rayfile.com/zh-cn/files/ee571c5e-bf84-11e3-be82-0015c55db73d/  http://www.rayfile.com/zh-cn/files/0667a845-bf86-11e3-99d1-0015c55db73d/  http://www.rayfile.com/zh-cn/files/0a283607-bf86-11e3-a34d-0015c55db73d/  http://www.rayfile.com/zh-cn/files/0f0c87c7-bf86-11e3-b60e-0015c55db73d/  http://www.rayfile.com/zh-cn/files/1060aeb0-bf86-11e3-919e-0015c55db73d/  http://www.rayfile.com/zh-cn/files/13900bd9-bf86-11e3-98f0-0015c55db73d/  http://www.rayfile.com/zh-cn/files/15783a45-bf86-11e3-b4f4-0015c55db73d/  http://www.rayfile.com/zh-cn/files/1951482b-bf86-11e3-b57e-0015c55db73d/  http://www.rayfile.com/zh-cn/files/1abb992e-bf86-11e3-ba68-0015c55db73d/  http://www.rayfile.com/zh-cn/files/1c7f0bc5-bf86-11e3-8cb6-0015c55db73d/  http://www.rayfile.com/zh-cn/files/1e49a64c-bf86-11e3-9a3a-0015c55db73d/  http://www.rayfile.com/zh-cn/files/21d0621c-bf86-11e3-b8a6-0015c55db73d/  http://www.rayfile.com/zh-cn/files/29981000-bf86-11e3-a6c4-0015c55db73d/  http://www.rayfile.com/zh-cn/files/2bdf8e21-bf86-11e3-9b1f-0015c55db73d/  http://www.rayfile.com/zh-cn/files/2ea28e97-bf86-11e3-a7fc-0015c55db73d/  http://www.rayfile.com/zh-cn/files/71d1f166-bf86-11e3-b7f8-0015c55db73d/  http://www.rayfile.com/zh-cn/files/736d975c-bf86-11e3-b20d-0015c55db73d/

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!