Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Addin class modules not available to other projects

Status
Not open for further replies.

JTBorton

Technical User
Jun 9, 2008
345
DE
Excel 2010b.
I have some classes that I developed for an addin. I want these classes to be available for other projects. I added the addin to the reference libraries, so it shows up in the object browser for other projects. But only the standard modules and worksheets are visible and available to other projects. How can I make the class modules and forms that I created available for other projects to use?

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
okay I set the Instancing property of the classes to 2-PublicNotCreatable, so now they show up in the object browser for other projects. But I want other projects to be able to create and instance these classes.

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
You can add public function in the add-in to instantiate such class:
Code:
Public Function New_Class1() As Class1
Set New_Class1 = New Class1
End Function


combo
 
Thanks combo! That worked.

Is it possible to create a dll file which contains the classes and modules that I can include as a reference instead of placing them as an add-in? That way perhaps I would be able to instance them as you would any other object.

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
Office developer version or visual basic include class modules when they create dlls, I don't know if they allow standard module compilation.
In fact, VBA project behaves like a 'dll' library. The problem is with VBE/VBA limitations.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top