vb.net Microsoft Office Web 组件不适用于 Visual Studio 2012
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20803435/
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
Microsoft office web Components not working with Visual Studio 2012
提问by logan
I am using Visual studio 2012 & creating a VB.Net Windows Forms Application whereas i am trying use microsoft office web components to embed an excel sheet into the form.
我正在使用 Visual Studio 2012 并创建一个 VB.Net Windows 窗体应用程序,而我正在尝试使用 microsoft office web 组件将 Excel 工作表嵌入到表单中。
I have installed, Office web components 11. while selecting the Microsoft office spread sheet 11.0Item it says following error
我已经安装了 Office web components 11。在选择Microsoft Office 电子表格 11.0项目时,它说以下错误
Failed to import the ActiveX control. Please ensure it is properly registered.
未能导入 ActiveX 控件。请确保它已正确注册。
When i build it, it shows following error.
当我构建它时,它显示以下错误。
------ 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 snapshotwhile dragging and dropping the Microsoft Spread sheet 11.0 item into the form

将 Microsoft 电子表格 11.0 项目拖放到表单中时的
PFB 快照
Even i have tried registering manually, PFB .. But getting same error!
即使我尝试过手动注册,PFB .. 但得到同样的错误!
Please tell me whats the problem and how to resolve it ?
请告诉我是什么问题以及如何解决?
采纳答案by logan
I got an answer from Microsoft Team! Here is it...
我得到了微软团队的答复!就这个...
Office Web Components is a deprecated technology and is no longer under active development. Hence we advise you to move to Excel services from OWC. This is documented in below articles
http://blogs.office.com/b/microsoft-excel/archive/2006/07/17/office-web-components-roadmap.aspx
Office Web Components 是一项已弃用的技术,不再处于积极开发阶段。因此,我们建议您从 OWC 转向 Excel 服务。这在下面的文章中记录
http://blogs.office.com/b/microsoft-excel/archive/2006/07/17/office-web-components-roadmap.aspx
回答by Al-3sli
OPen CMD and write :
打开 CMD 并写入:
REGSVR32 YouDllName.dll
if you get error message :
如果您收到错误消息:
Filename.dll is not an executable file and no registration helper is registered for this file type.
Use this command :
使用这个命令:
cd \windows\syswow64
regsvr32 c:\YouDllName.dll path for the dll file.
UPDATE:
The file is named owc11.dll, and its default location is
更新:文件名为owc11.dll,其默认位置为
C:\Program Files\Common Files\Microsoft Shared\Web Components\11
C:\Program Files\Common Files\Microsoft Shared\Web Components\11
or, if you have 64-bit Windows:
或者,如果您有64-bit Windows:
C:\Program Files (x86)\Common Files\Microsoft Shared\Web Components\11
C:\Program Files (x86)\Common Files\Microsoft Shared\Web Components\11
回答by Yavuz
please visit this address. I am not able to understand their tech words, but the buttom line is that the OWC will no longer run with the office.
请访问此地址。我无法理解他们的技术用语,但最重要的是 OWC 将不再与办公室一起运行。
http://blogs.office.com/2006/07/17/office-web-components-roadmap/
http://blogs.office.com/2006/07/17/office-web-components-roadmap/
回答by Hever Costa Rocha
In some exoteric case, the key {91A74EB0-EFA0-482B-B43C-35CFC74B275F} can not be deleted. In these cases do the following:
在一些公开的情况下,无法删除密钥{91A74EB0-EFA0-482B-B43C-35CFC74B275F}。在这些情况下,请执行以下操作:
1) Use the utility tool RunAsSystem
1) 使用实用工具 RunAsSystem
https://www.raymond.cc/blog/full-control-permission-to-delete-or-edit-restricted-windows-registry/
https://www.raymond.cc/blog/full-control-permission-to-delete-or-edit-restricted-windows-registry/
2) Delete the key {91A74EB0-EFA0-482B-B43C-35CFC74B275F}
2)删除键{91A74EB0-EFA0-482B-B43C-35CFC74B275F}
3) Be Happy :-)
3) 快乐:-)
回答by C.K
I got the same problem. This is my coding environment by following: VB2008/ Win7 SP1/ IE10/ OWC11
我遇到了同样的问题。这是我的编码环境:VB2008/Win7 SP1/IE10/OWC11
I got this problem when I upgrade IE from 8 to 10.
当我将 IE 从 8 升级到 10 时,我遇到了这个问题。
My solution is that starts VB with administrator. Then, add the OWC11 component again. Right click on your mouse on the toolbox to click "selecting items". Next, go into COM page, then go to the place where OWC11.DLL originally is placed, re-add it. Finally, the problem will be solved. Try it.
我的解决方案是用管理员启动VB。然后,再次添加 OWC11 组件。在工具箱上右键单击鼠标以单击“选择项目”。接下来进入COM页面,然后到原来放置OWC11.DLL的地方,重新添加。最后,问题将得到解决。尝试一下。
In my case, OWC11.dll is located at C:\Program Files (x86)\Common Files\Microsoft Shared\Web Components\11\owc11.dll
就我而言,OWC11.dll 位于 C:\Program Files (x86)\Common Files\Microsoft Shared\Web Components\11\owc11.dll
回答by Pouya Samie
Ok here is my Solution:
好的,这是我的解决方案:
After you add it to ToolBox, Drag and Drop it in your Windows Form... The error will raise.. click Ok..
将其添加到 ToolBox 后,将其拖放到 Windows 窗体中...错误将引发...单击确定...
Rebuil Your Project (The DLL will be copied)
重建您的项目(DLL 将被复制)
Re-Drag and Drop the component and now, it'll work
重新拖放组件,现在,它会工作

