无法在 Vb.net 中创建 ActiveX 组件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43363376/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 20:14:53  来源:igfitidea点击:

Cannot create ActiveX component in Vb.net

.netvb.netinternet-explorer

提问by Pirate

I am facing a problem in vb.net forms application. I'm loading the Internet Explorer using the following code.

我在 vb.net 表单应用程序中遇到了问题。我正在使用以下代码加载 Internet Explorer。

Dim browser As Object = CreateObject("InternetExplorer.Application")
browser.Visible = TRUE

When creating the application for first time, it works fine. Loads the Internet Explorer correctly. But for second time if run the application the following run time error is occurring.

第一次创建应用程序时,它工作正常。正确加载 Internet Explorer。但是,如果第二次运行应用程序,则会发生以下运行时错误。

Cannot create ActiveX component at the CreateObject line.

无法在 CreateObject 行创建 ActiveX 组件。

I don't know what is wrong with the application and I searched and google lot but did not find the solution.

我不知道该应用程序有什么问题,我进行了搜索和谷歌搜索,但没有找到解决方案。

Thanks in Advance.

提前致谢。

回答by Thanh Phi

If you're using library Interop.Excel or Interop.Work, It has caused too many processes (Excel.exe or Work.exe), you have to End Process that process.

如果您正在使用库 Interop.Excel 或 Interop.Work,它会导致过多的进程(Excel.exe 或 Work.exe),您必须结束处理该进程。

enter image description here

在此处输入图片说明