VB.NET CreateObject dll 歧义
您可以帮助解决以下问题吗?
我尝试在我的代码中使用 Some.dll 版本 5.0。 然而,Excel对同一个dll有多个引用,早期版本如4.0 如果我运行:
Set co = CreateObject("SomeClass.Object")
即使我在“工具”->“引用”中为最新的 Some.dll 创建了引用,它也会调用最旧的 dll 之一,该 dll 不具有某些功能。
我没有更改注册表、从计算机中删除程序的管理员权限。
是否可以以某种方式设置对最新版本 dll 的引用?
我尝试过:
Private Declare Function LoadLibrary Lib "kernel32"...
lb = LoadLibrary(C:\somepath\Some.dll) ' lb is the 5.0 version dll that should be used
set co = CreateObject("lb.Object")
但是,它不起作用(“ActiveX...无法创建对象”)
并浏览了所有网络,但找不到建议,如何使用特定的 dll 路径创建对象。
请帮忙,谢谢:吉姆
could you please help with the following
I try to use Some.dll version 5.0 within my code.
However, Excel has multiple reference for the same dll, with earlier versions like 4.0
If I run:
Set co = CreateObject("SomeClass.Object")
even if I created a reference in Tools->References for the newest Some.dll, it calls one of the oldest dll, that does not have some functionality.
I do not have admin right to change registry, remove programs from my computer.
Is it possible somehow set reference to the newest version dll?
I tried:
Private Declare Function LoadLibrary Lib "kernel32"...
lb = LoadLibrary(C:\somepath\Some.dll) ' lb is the 5.0 version dll that should be used
set co = CreateObject("lb.Object")
however, it is not working ("ActiveX... can't create object")
and looked through all the net, but could not find advise, how to create object with a specific dll path.
Please help, thanks: Jim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可以在两者之间找到解决方案,
这是一个名为 CreateObjectFromFile() 的函数,它可以提供帮助。
I could find sollution inbetween,
it is a function called CreateObjectFromFile() that helps.
我遇到了同样的问题,并通过以下方式解决:
参考旧版本:
参考新版本:
I've met the same problem, and solved it this way:
Reference to old version:
Reference to new version: