-1

is it possible to include some kind of libraries inside of VBA that will enable me to use c# functions that i wrote?

Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062

2 Answers2

5

You need to expose managed code to COM using the [ComVisible] attribute.

For more information, see here.

EDIT: For example:

[ComVisible(true)]
public class MyClass {
    public int GetNumber(string name) { ... }
}
SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
3

You need to use the ComVisible attribute. Here's a similar question

Community
  • 1
  • 1
ichiban
  • 6,162
  • 3
  • 27
  • 34