vb.net 升级到 Office 2016 参考错误:Microsoft.Office.Interop.Excel
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33219807/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Upgrading to Office 2016 Reference Error: Microsoft.Office.Interop.Excel
提问by Fly Guy
Visual Studio 2015 is giving me an error stating that the "Namespace or type specified in the Imports 'Microsoft.Office.Interop.Excel' doesn't contain any public member or cannot be found." I just started getting this error after upgrading to Office 2016 from 2013.
Visual Studio 2015 给我一个错误,指出“导入‘Microsoft.Office.Interop.Excel’中指定的命名空间或类型不包含任何公共成员或无法找到。” 从 2013 年升级到 Office 2016 后,我才开始收到此错误。
I don't have a .NET tab in my References section to add this reference. MSDN is only giving me an option to download the Primary Interop Assembly for Visual Studio 2013 and it is not fixing my issue. I still don't see the .NET tab.
我的参考部分中没有 .NET 选项卡来添加此参考。MSDN 只给了我一个下载 Visual Studio 2013 的主互操作程序集的选项,它没有解决我的问题。我仍然没有看到 .NET 选项卡。
How do I fix these reference errors?
如何修复这些参考错误?
回答by Michael Ribbons
With Office 2016 we can now add a reference again.
使用 Office 2016,我们现在可以再次添加引用。
Delete your existing Microsoft.Office.Interop.Excel reference.
删除现有的 Microsoft.Office.Interop.Excel 引用。
Right click references, add reference
右键单击引用,添加引用
Select COM Search for Excel Check Microsoft.Office 16.0 Object Library Click OK
选择 COM 搜索 Excel 检查 Microsoft.Office 16.0 对象库 单击确定
回答by cbehh
At the Moment there's no Office 2016 PIA. You have to reinstall Office 2013 and use that Office 15 PIA 'til Microsoft has released the Office 2016 PIA.
目前没有 Office 2016 PIA。您必须重新安装 Office 2013 并使用该 Office 15 PIA,直到 Microsoft 发布 Office 2016 PIA。