在 Excel VBA 中,如何访问存储在已安装加载项中的子程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4066171/
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
In Excel VBA, how to access subs stored in an installed Add-In?
提问by xiaodai
I have create an Excel Add-In. In that add-in are some modules and let's say module1 is one them. In module1 I have a sub declared as public sub abc() end sub
我已经创建了一个 Excel 加载项。在该加载项中有一些模块,假设 module1 就是其中之一。在 module1 我有一个 sub 声明为 public sub abc() end sub
In my workbook I want to be able to use the function abc defined in the add in. It doesn't seem to work!
在我的工作簿中,我希望能够使用插件中定义的函数 abc。它似乎不起作用!
E.g. I install the Addin so that now it appears in the VBAProject sections. I create a sub in my main workbook (this is not the add-in workbook) and have a sub called def says
例如,我安装了 Addin,以便它现在出现在 VBAProject 部分中。我在我的主工作簿(这不是加载项工作簿)中创建了一个子程序,并且有一个名为 def 的子程序说
sub def()
call abc
end sub
sub def1()
call module1.abc
end sub
Neither of these work. Please help.
这些都不起作用。请帮忙。