deploy com-enable C# ,.Net dll to workstation
Posted on 2014-03-07
I am trying to write a com-enabled .Net DLL in C#, using the .Net 3.5 framework, and on my development machine I can use it in VBA (Excel) like this:
Public Sub try()
Dim CR As CRPassThroughCOM.Main
Set CR = New CRPassThroughCOM.Main
Dim tryit As Boolean
tryit = CR.Report
I did notice that when I added the dll to the references, that it pointed to the debug folder, not the release folder.
I then sent the dll (from the release folder) to a personal machine that does not have the development environment. I registered it with regasm, which on that machine was in the .Net 4.0 framework folder. I used the /tlb and /codebase switches.
On the personal machine, in Excel VBA I can choose the reference, etc. However, at tryit = CR.Report, it fails. Intellisense does not see that method and it won't run.
The DLL looks like this:
public interface IMain
public class Main : IMain
public bool Report()
MessageBox.Show("We are good, I guess");
catch (Exception ex)
MessageBox.Show(ex.Message);//TODO: take this out
Any ideas what I can do to troubleshoot this? I had to mark the assembly Make Assembly com-Visible to get this method to show up even on the development machine.