Has Anyone every found a simple way to Share/use Routines from one Project with another Project.
I get very tired of loading up new projects with code I know is already loaded in another Project.
Any Ideas would help me out
Thanks,
Marty Raley
|
|
|
Has Anyone every found a simple way to Share/use Routines from one Project with another Project.
I get very tired of loading up new projects with code I know is already loaded in another Project.
Any Ideas would help me out
Thanks,
Marty Raley
I have a separate dvb for library typ code. I call it Toolbox.dvb. In any project that you need to use code from the toolbox, just reference the dvb and it will automatically load when the main project loads. You will also be able to use Intellisense by starting with the toolbox's project name. The only cavaeat is you have to take a couple of extra steps if your toolbox will include class modules. But you won't have multiple copies of functions floating around.
C:> ED WORKING.... ▒
That sounds like just what I need. Can you show me how it is referenced from one to the other.
In the project that will use code from the toolbox: Tools>References, check Toolbox,dvb. Then, if you are calling a sub/func from the toolbox, use the format, Project.Module.Procedure.
C:> ED WORKING.... ▒
Well, Thanks! That looks like it did it. I'll play around and see just what can be done with this new-to-me Idea.
I always try to take programming to the limits.
Limits of my knowledge that is...
Marty
This is the exact problem I am currently having in that the reference project is just classes and I am not able to access them. Could you please elaborate on the "extra steps" part?Originally Posted by Ed Jobe
Thanks!
Ben
OK, for each class that you want to expose to use outside the toolbox, you need to change its Instancing property to PublicNotCreateable. Now other projects can see it but not create an instance. Therefore, you need to create a public module with a function that returns an instance of the class, i.e. where, ObjDbx is the name of a class in my toolbox.Originally Posted by Ben Jones
Code:Public Function CreateObjDbxClass() As ObjDbx Dim objTemp As ObjDbx Set objTemp = New ObjDbx Set CreateObjDbxClass = objTemp Set objTemp = Nothing End Function
C:> ED WORKING.... ▒
That worked beautifully...Thank you!
That was a delayed response. You're welcome.Originally Posted by Ben Jones
C:> ED WORKING.... ▒