See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: Sharing Modules & Classes Between Projects

  1. #1
    Member
    Join Date
    2002-12
    Posts
    3
    Login to Give a bone
    1

    Thumbs up Sharing Modules & Classes Between Projects

    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

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    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....

  3. #3
    Member
    Join Date
    2002-12
    Posts
    3
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    That sounds like just what I need. Can you show me how it is referenced from one to the other.

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    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....

  5. #5
    Member
    Join Date
    2002-12
    Posts
    3
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    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

  6. #6
    Active Member
    Join Date
    2002-06
    Location
    Portland, OR
    Posts
    83
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    Quote Originally Posted by Ed Jobe
    ...The only cavaeat is you have to take a couple of extra steps if your toolbox will include class modules...
    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?

    Thanks!

    Ben

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    Quote Originally Posted by Ben Jones
    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?

    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.

    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....

  8. #8
    Active Member
    Join Date
    2002-06
    Location
    Portland, OR
    Posts
    83
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    That worked beautifully...Thank you!

  9. #9
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: Sharing Modules & Classes Between Projects

    Quote Originally Posted by Ben Jones
    That worked beautifully...Thank you!
    That was a delayed response. You're welcome.
    C:> ED WORKING....

Similar Threads

  1. Replies: 0
    Last Post: 2013-04-17, 04:38 AM
  2. Sharing System Families in projects
    By rsotak in forum Revit Structure - Families
    Replies: 1
    Last Post: 2010-05-27, 06:23 AM
  3. Eliminating load AEC modules
    By cadconcepts in forum AutoLISP
    Replies: 0
    Last Post: 2008-06-30, 08:51 PM
  4. sharing projects between 2 systems
    By dinman in forum ACA General
    Replies: 5
    Last Post: 2005-05-15, 06:36 PM
  5. VBA Forms and Modules
    By msretenovic in forum VBA/COM Interop
    Replies: 2
    Last Post: 2004-11-01, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •