简体   繁体   English

是否有适用于 Office365 和 Visual Studio 2010 的 PIA?

[英]Is there a PIA for Office365 and Visual Studio 2010?

Is there a PIA for Office365 and Visual Studio 2010?是否有适用于 Office365 和 Visual Studio 2010 的 PIA? If so how do I get it?如果是这样,我如何获得它? If not then what is the equivalent?如果不是,那么等价物是什么? There are no PIAs on my PC for Office365 or anything beyond Office 14. Context: I am migrating all my files/Folders from an old PC to a new PC.我的 PC 上没有用于 Office365 或 Office 14 以外的任何 PIA。 上下文:我将所有文件/文件夹从旧 PC 迁移到新 PC。 The systems involved have the following installed: Old: Windows 7(64 bit), Office 2007, Visual Studio 2010 Professional New: Windows 10 (64 bit), Office365, Visual Studio 2010 Professional涉及的系统安装了以下系统: 旧:Windows 7(64 位)、Office 2007、Visual Studio 2010 Professional 新:Windows 10(64 位)、Office365、Visual Studio 2010 Professional

Much of my work involves Excel VBA routines calling COM enabled Class Libraries (.dll) to obtain and manipulate various data which the .dlls then return the results to Excel for display and/or other manipulations.我的大部分工作涉及 Excel VBA 例程,调用启用 COM 的类库 (.dll) 来获取和操作各种数据,然后 .dll 将结果返回到 Excel 以进行显示和/或其他操作。 The Class Libraries are written by me using VS2010 VB.Net.类库是我使用 VS2010 VB.Net 编写的。 All of this works as expected on my old PC.所有这些都在我的旧电脑上按预期工作。

The first sign of my Problem is this Warning: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Microsoft.Common.targets(2015,5): warning MSB3304: Could not determine the dependencies of the COM reference "Microsoft.Office.Interop.Excel".我的问题的第一个迹象是这个警告:C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Microsoft.Common.targets(2015,5):警告 MSB3304:无法确定 COM 引用的依赖关系“Microsoft .Office.Interop.Excel”。 Element not found.未找到元素。 (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND)) which I get when attempting to rebuild a Class Library assembly with Visual Studio 2010. (来自 HRESULT 的异常:0x8002802B (TYPE_E_ELEMENTNOTFOUND)),这是我在尝试使用 Visual Studio 2010 重建类库程序集时得到的。

Since this was a Warning, I pushed on in Debug mode.由于这是一个警告,我在调试模式下继续。 My Startup Project is a test application which starts Excel with a test Workbook.我的启动项目是一个测试应用程序,它使用测试工作簿启动 Excel。 In that Workbook, I have code that attempts to set up an instance of my .dll, the .dll that Imports Microsoft.Office.Interop.Excel.在该工作簿中,我有一些代码尝试设置我的 .dll 实例,即导入 Microsoft.Office.Interop.Excel 的 .dll。 It errors out with the message: Error trying to Create the StockDataTest.Tester instance.它错误地显示以下消息:尝试创建 StockDataTest.Tester 实例时出错。 Error is: runtime error '429: ActiveX component can't create object'.错误是:运行时错误“429:ActiveX 组件无法创建对象”。

I suspect that the runtime error is related to the build time Warning and have been searching and poking around based on that suspicion.我怀疑运行时错误与构建时间警告有关,并且一直基于这种怀疑进行搜索和探索。 I suspect that it has to do no PIA for Office365/VS2010.我怀疑它不必为 Office365/VS2010 做 PIA。 The first time I opened this Solution after copying to the new machine, VS210 changed the old reference to "Microsoft.Office.Interop.Excel".复制到新机器后第一次打开这个解决方案,VS210将旧引用改为“Microsoft.Office.Interop.Excel”。 to a reference that actual refers to C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.Office.Interop.Excel\\15.0.0.0__71e9bce111e9429c\\Microsoft.Office.Interop.Excel.dll which is the one that it could not determine the dependencies for.引用实际指的是 C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.Office.Interop.Excel\\15.0.0.0__71e9bce111e9429c\\Microsoft.Office.Interop.Excel.dll 这是它无法确定的依赖项.

Any help will be appreciated.任何帮助将不胜感激。

The PIAs for the currently installed version of Office on any machine are located in the GAC.当前在任何计算机上安装的 Office 版本的 PIA 位于 GAC 中。 By default, Visual Studio will look for them in its own folders - Visual Studio installs the version of the Office PIAs that are current for its version there.默认情况下,Visual Studio 将在其自己的文件夹中查找它们 - Visual Studio 会安装与其版本对应的最新 Office PIA 版本。

So you need to use the COM tab to reference a different set of PIAs.因此,您需要使用 COM 选项卡来引用一组不同的 PIA。 The names of the COM PIAs differ somewhat from those installed by Visual Studio. COM PIA 的名称与 Visual Studio 安装的名称有些不同。 As I recall, they start with "Microsoft", such as "Microsoft.Excel" (I'm currently on a mobile device).我记得,它们以“Microsoft”开头,例如“Microsoft.Excel”(我目前使用的是移动设备)。

The problem was solved by uninstalling my 64-bit version of Office 365 and installing the OFF-LINE version as 32-bit.通过卸载我的 64 位版本的 Office 365 并将离线版本安装为 32 位解决了该问题。 After very limited tweaking to accommodate the 32-bit version, the problem was solved.经过非常有限的调整以适应 32 位版本后,问题解决了。 I am not sure if the Off-Line install or the change to 32-bit or if both changes were required.我不确定是离线安装还是更改为 32 位,或者两者都需要更改。

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

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