简体   繁体   English

我已经使用Visual Studio Express C#为2010 Office(64位)编写了Excel代码,如何在2010 Office(32位)上运行它?

[英]I have written excel code for 2010 Office (64 bit) with visual studio express c#, how to run it on 2010 office (32 bit)?

I have written an excel code for my computer (Windows 7, Excel 2010 64 bit version). 我已经为我的计算机(Windows 7,Excel 2010 64位版本)编写了一个Excel代码。 It works fine. 工作正常。

I wanted to test it on a 32 pc. 我想在32台PC上进行测试。 (Windos XP 32 bit, Excel 2010 32 bit version). (Windos XP 32位,Excel 2010 32位版本)。

As expected it didn't work when it tries to communicate with excel. 如预期的那样,当它尝试与excel通信时没有用。

How I can overcome this problem and make my code also run in 32 bit excel? 如何克服此问题并使我的代码也可以在32位excel中运行?

Thank you. 谢谢。

Change your project's Platform Target to Any CPU also i would recommend not to use Office Interop assemblies, Then your application will depend on office version whereas you could use open source libraries which is compatible with any office version. 将项目的Platform Target也更改为Any CPU我也建议不要使用Office Interop程序集,然后您的应用程序将取决于Office版本,而您可以使用与任何Office版本兼容的开源库。 NetOffice is good example which supports office 2000, 2002, 2003, 2007, 2010, 2013. NetOffice是支持Office 2000、2002、2003、2007、2010、2013的很好的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM