I create the following class library in C#:
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
//[Guid(<Generate GUID here>)]
public interface _None1
{
int retval { get; }
}
[ClassInterface(ClassInterfaceType.None)]
//[Guid(<Generate GUID here>)]
[ProgId("Lotr.Test")]
public class None : _None1
{
public int retval
{
get
{ return 1; }
}
}
Then I compile it using "Register for COM Interop" and "Make Assembly COM-visible" options.
When I try to access it using Excel 2007 VBA on my machine, works fine. However, if I take the .dll and .tlb files to another machine, and then use regasm to register it, the registration happens fine, I am able to reference this in Excel VBA via the tlb, the intellisense works like clockwork, but while execution, VBA runtime gives the following error:
"Runtime error:-2147024894 (80070002)"
"Automation Error: The system cannot find the file specified."