I was to use code written in C# from an Excel VBA Function. I have written a simple c# object like this:
[ComVisible(true), Guid("B74A3D2A-7F80-40b4-9398-FB4BAD0BF234"), ProgId("ExcelTest.Class1")]
public class Class1
public void Test()
System.Windows.Forms.MessageBox.Show("Its working", "Yay!");
I am building it from Visual Studio 2005, and I checked the register for COM interop check box in the build properties. I wrote a test VBS file that looks like this:
Set FooObj = CreateObject("ExcelTest.Class1")
The test VBS file works fine, but if I put the same code in an excel module and try to step through the code, execution of the function stops when CreateObject is called.
Does anybody know why it doesn't work from Excel or does somebody have suggestions on how I can trouble shoot this?