Results 1 to 8 of 8
  1. #1
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Saving changes to add-in libraries in VBE (A2K)

    I have a library database (with an .mda extension) that I use as an add-in to various other databases.

    As Helen Feddema noted in WAW 5 v05, if I'm editing code in the VBEditor from a database that uses the add-in, I can also view code from the add-in library database.

    However, if I make changes to any of the code in the add-in library, I can't save the changes. I'm free to compile the altered code (for temporary testing), but I don't seem to have the option of saving the changes. (The Save command for the library database is greyed-out in the File menu.) If I move to the Access window, close the open database (that uses the library database as an add-in) and then open the library database, the modules that were open in the VBEditor (with the unsaved changes) have closed without saving the changes (and with no warning).

    Obviously I can edit the code in the library database by just opening the library database in the Access window, but is there some way I can save my editing changes if I'm accessing that code in the VBEditor through another database that uses the library database as an add-in?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Saving changes to add-in libraries in VBE (A2K)

    As far as I know, an add-in is loaded as a read-only file. You *must* open it directly if you want to make changes. The same holds for add-ins in Excel (.xla).

  3. #3
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Saving changes to add-in libraries in VBE (A2K)

    Thanks for the prompt response. It's consistent with my experience, but inconsistent with Helen's article. If she (or anyone else) knows something you and I don't, I'd love to hear about it. Otherwise Helen may want to tweak "Writing Access Add-ins, Part 5" (part of Access Archon Column #108), since it specifically describes being able to edit add-in code in the VBEditor (from the calling database) without having to separately open the add-in database.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Saving changes to add-in libraries in VBE (A2K)

    I can remember doing that in a code library I built for an application, but as I recall, it was unreliable. In 2002, I don't even think it's possible. There is one situation where it is definitely impossible in either version, and that is if you compiled the library into an MDE before making it an add-in. Let me clarify that, if you compiled it into an MDE before *using* it as an add-in. I wasn't sure from your description whether you were merely setting a reference to the file or actually installing it as an add-in either.
    Charlotte

  5. #5
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Saving changes to add-in libraries in VBE (A2K)

    I experience the same inability to save from the calling database whether I both set a Reference and install the library as an Add-in or simply set a Reference. Because Access "installs" an Add-in library by (among other things) copying it to the default Addins directory (a subdirectory under Documents and Settings[username]Application DataMicrosoft), whereas I want to keep it in my own database directory family (for backup and organizational purposes), I've moved to simply setting a Reference, which seems to work fine.

    What are the added benefits (if any) of "installing" an Add-in code library (rather than simply setting a Reference)?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Saving changes to add-in libraries in VBE (A2K)

    Others may correct me, but if your database is only meant as a code library, a reference should be enough. Installing an add-in not only copies the file to the default folder, but also makes a menu item, wizard or builder available in Access; neither of these apply to a code library.

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Saving changes to add-in libraries in VBE (A2K)

    As Hans said, there isn't really any reason to install a code library as an add-in, at least not unless there is an interface to it that you want to use. You generally use an add-in when you want to be able to use objects like forms, etc., in the add-in, either from the user interface or in the VBE window. Just setting a reference is more than adequate for a code library, even if you have classes in that library (which take a little more work to make creatable), if all you want to do is use the routines in that library.
    Charlotte

  8. #8
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Saving changes to add-in libraries in VBE (A2K)

    Actually, my library includes a few forms that open and function fine in the calling database even though the library database isn't an installed Add-in. (The library database does include a USysRegInfo table, but isn't actually installed as an Add-in.) It may well be that Hans is right that what needs to be installed as an Add-in is a file that has menus, builders or wizards. I've never messed with those.

    Thanks to both of you for taking the time to respond.

Posting Permissions

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