You need to run RegAsm.exe on the C# assembly, just as you would need to run
RegSrv32.exe on unmanaged COM libraries for them to be registered properly
in the system registry.
The installation/deployment projects should do this step for you as part of
the installation process for your component.
You can use the RegistrationServices class if you want to register other
components from code at runtime. In addition, you can create a function in
your component and apply the ComRegisterFunctionAttribute to it if you want
to insert custom registry entries (with the Microsoft.win32.Registry class)
when RegAsm is executed against your component.
Also, there's registration-free COM interop, which you might want take a
look at:
http://msdn.microsoft.com/library/en...asp?frame=true
It's got some limitations and other special steps involved, so read
carefully.
-Rob Teixeira [MVP]
"Frank X" wrote in message
...
Excel 2002 introduced a capability to add custom worksheet functions to
Excel direct from a COM/ActiveX object.
I can use C# to develop a COM object which I can use fine from Excel/VBA,
however I can't see it using the Excel Tools/Add-Ins - Automation button.
Now this appears to be because it is not an *ActiveX* COM object,
apparently
in order to be an ActiveX object the COM object needs to have a
'CLSID'/Programmable key entry in the registry.
I can add this Key myself in regedt32 and then the C# COM object works
fine
as an Automation Add-in. But I'm sure this isn't the correct way to do it,
so is there a C#/.Net attribute or something to create the "Programmable"
registry key automatically?