I've created a class library DLL and wrapped it up, but when I use it within VBA (Excel) it has no methods. All is well from another .NET program:
This is my code:
namespace NeilLibrary
{
public interface INeilTest
{
string DoMethodReturn(string name);
string DoMethodOut(string name, out string name2, out bool isPrev);
}
[Guid("BA7CC0F2-9C07-4EF9-B799-18D317B7E293")]
[ComVisible(true)]
public class NeilTest
{
public NeilTest() { }
[ComVisible(true)]
public string DoMethodReturn(string name)
{
return "name: " + name;
}
[ComVisible(true)]
public string DoMethodOut(string name, out string name2, out bool isPrev)
{
name2 = "New Value";
isPrev = true;
return "Name: " + name;
}
} }
I built it with COM enabled in the assembly and I ran the following command:
regasm.exe NeilLibrary.dll /tlb:neil.tlb
Which worked fine. In Excel I imported the tlb and it appears in the object browser so it's created ok, but there are no methods. The interface is shown though, with it's methods, but that's not much use.
Can somebody help please.
I added the no-arg constructor because I read somewhere with someone with a similar problem had to do this.