vba:使用代码引用类型库 [英] vba: referencing type libraries with code

查看:617
本文介绍了vba:使用代码引用类型库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不是来自visual basic editor菜单的库引用。我的意思是,我可以为任何办公应用程序编写代码,允许我引用特定的类型库 - 比如vb.net中的Imports关键字。我知道这可以用于Access,但我现在正在使用excel。或者也许有一种方法可以在Visual Basic编辑器中自动完成引用?谢谢。

Not library referencing from the visual basic editor menu. I mean is there code that I can write, for any office application, that allows me to reference a particular type library--like the Imports keyword in vb.net. I know this is possible for Access, but I'm working with excel now. Or perhaps there is a way of automating the referencing done in the visual basic editor? Thanks.

推荐答案

您可以使用AddFromFile或AddFromGuid函数动态引用VBA中的dll。
You can use the AddFromFile or AddFromGuid functions to dynamically reference dlls in VBA.


这篇关于vba:使用代码引用类型库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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