2

I have made the dll COM Visible and registered the dll using RegAsm tool. In excel i am adding a reference to the TLB file for my .NET dll, then creating an instance of my class in excel VBA.

Real problem comes when I release new version of dll I have to manually add reference to new dll again and this excel application is going to be distributed to many users, so for the first time they have to manually add a reference to TLB file.

Is there any way to auto reference TLB from excel VBA or can be loaded programmatically before type instance being created?.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Sunil S
  • 391
  • 3
  • 5
  • Have a look here: http://stackoverflow.com/questions/9879825/how-to-add-a-reference-programmatically-vba-excel – Daniel Dušek Feb 20 '13 at 08:46
  • Add from the suggest links work, but before Add I want to add if there is any previous reference of this type. VBA is in excel 2003 in giviong error in the line "ThisWorkBook.VBProject.Referebce.Remove theRef" . Error which give is "Cant break into this module" and throw as exception. Please suggest some good way to remove existing reference from excel VBA. I was following this link to remove the excel. http://www.vbaexpress.com/kb/getarticle.php?kb_id=267. Only Different thing i m doing is that I am not checking IsBroken flag of referces, i match by name and remove. this gives error !! – Sunil S Mar 01 '13 at 07:08

0 Answers0