生成在VB.net中开发的dll,可在VBA Excel中使用 [英] Generate dll developped in VB.net usable in VBA Excel

查看:501
本文介绍了生成在VB.net中开发的dll,可在VBA Excel中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要在VB.net中开发函数才能在VBA Excel中使用它们。我的计算机上没有管理员权限,所以我正在寻找一个解决方案,从我的dll生成tlb文件,无需管理员权限。



这可能不是正确的做法,我愿意接受任何建议。



非常感谢。

解决方案

< blockquote>请参阅,例如, https://richnewman.wordpress.com/2007/04/15/a-beginner's-guide-to-calling-a-net-library-from-excel [ ^ ]。



它与您的系统权限无关。



-SA


你可能运气不好。要通过VBA使用代码,您需要为.net组件提供COM接口,然后使用regsvr32注册这些接口。如果您没有管理员或无法更改注册表权限,您可能无法执行此操作。



http://stackoverflow.com/questions/569218/what-permissions-rights-are -needed-run-regsvr32-sc-myocx-ocx [ ^ ]


根据我的经验,你必须通过注册自定义COM dll regasm工具 [ ^ ]能够在非开发系统上使用它。要运行regasm工具,您需要具有管理员权限。


Hi,

I need to develop functions in VB.net for using them in VBA Excel. I don't have Admin permissions on my computer, so I'm looking for a solution to generate tlb file from my dll without needed admin right.

That's maybe not the right way to do it, I'm open to any advice.

Thanks a lot.

解决方案

Please see, for example, https://richnewman.wordpress.com/2007/04/15/a-beginner’s-guide-to-calling-a-net-library-from-excel[^].

It has nothing to do with your system permissions, whatsoever.

—SA


You're probably out of luck. To use your code via VBA you need to give your .net components COM interfaces and then register those interfaces using regsvr32. If you don't have admin or can't change registry permissions you probably won't be able to do this.

http://stackoverflow.com/questions/569218/what-permissions-rights-are-needed-to-run-regsvr32-s-c-myocx-ocx[^]


As per my experience, you have to register custom COM dll via regasm tool[^] to be able to use it on non-development system. To run regasm tool you need to have admin permissions.


这篇关于生成在VB.net中开发的dll,可在VBA Excel中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆