【发布时间】:2010-06-06 22:47:03
【问题描述】:
是否可以在 VBA 中包含某种库,使我能够使用我编写的 c# 函数?
【问题讨论】:
-
请给我一些代码而不是给我链接
-
你点击了链接吗?
是否可以在 VBA 中包含某种库,使我能够使用我编写的 c# 函数?
【问题讨论】:
您需要使用 [ComVisible] 属性向 COM 公开托管代码。
有关详细信息,请参阅here。
编辑:例如:
[ComVisible(true)]
public class MyClass {
public int GetNumber(string name) { ... }
}
【讨论】:
您需要使用ComVisible 属性。
这是similar question
【讨论】: