从Excel的VBA调用加载项功能 [英] Calling a Add-in function from Excel's VBA

查看:205
本文介绍了从Excel的VBA调用加载项功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Erlangs使用Excel加载项: http://abstractmicro.com/erlang/helppages/ref-erlbblockage.htm

I am using an Excel Add-in for an Erlangs: http://abstractmicro.com/erlang/helppages/ref-erlbblockage.htm

我尝试通过VBA在外接程序中调用Erlang-B函数:

I try to call the Erlang-B function within the Add-in from within VBA thus:

Function Erl(Erlangs As Double, Capacity As Double)
    Erl = Application.WorksheetFunction.ErlbBlockage(Capacity, Erlangs)
End Function

...但是它不起作用.我在Excel单元格中返回了 #VALUE!.我认为是因为该功能不是标准Excel的一部分(它在外接程序中).那我怎么称呼它呢?

...but it doesn't work. I get #VALUE! returned in the Excel cell. I think it is because the function is not part of standard Excel (it is in the Add-in). So how do I call it?

推荐答案

尝试在VBA项目中设置对Erlang插件的引用
VBE->工具->参考检查A_Erlang

Try setting a reference in your VBA project to the Erlang Addin
VBE-->Tools-->References check A_Erlang

然后您可以直接从VBA调用插件中的函数

Then you can call the functions in the addin directly from VBA

Myvar = ErlbBlockage(capacity, erlangs)

这篇关于从Excel的VBA调用加载项功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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