【发布时间】:2014-01-15 04:58:46
【问题描述】:
我正在使用 Visual Studio 2012 并创建一个 VB.Net Windows 窗体应用程序,而我正在尝试使用 Microsoft Office Web 组件将 Excel 工作表嵌入到表单中。
我已经安装了 Office web components 11。在选择 Microsoft office 电子表格 11.0 项目时显示以下错误
无法导入 ActiveX 控件。请确保已正确注册。
当我构建它时,它显示以下错误。
------ Rebuild All started: Project: WindowsApplication11, Configuration: Debug Any CPU ------
COM Reference 'OWC11' is the interop assembly for ActiveX control 'AxOWC11' but was marked to be linked by the compiler with the /link flag. This COM reference will be treated as a reference and will not be linked.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "7c0ffab0-cd84-11d0-949a-00a0c91110ed" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): error MSB3303: Could not resolve COM reference "0002e558-0000-0000-c000-000000000046" version 1.0. Object reference not set to an instance of an object.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "7c0ffab0-cd84-11d0-949a-00a0c91110ed" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): error MSB3303: Could not resolve COM reference "0002e558-0000-0000-c000-000000000046" version 1.0. Object reference not set to an instance of an object.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
PFB 快照,同时将 Microsoft 电子表格 11.0 项拖放到表单中
即使我尝试过手动注册,PFB .. 但得到同样的错误!
请告诉我是什么问题以及如何解决?
【问题讨论】:
-
错误消息清楚地表明问题是 COM/ActiveX 库未注册。您是否尝试过重新注册库?
-
@Dai : 请告诉我如何重新注册?
-
此页面将帮助ss64.com/nt/regsvr32.html,但我不知道文件名是什么。还要确保您构建的是 32 位 EXE,而不是 AnyCPU 或 x64,除非您使用的是 64 位 Office 2010/2013 组件。
-
@Dai : 我只使用 64 位
-
我也不知道要提供 DLL_Name !有什么建议吗?
标签: .net excel vb.net visual-studio-2012