Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Installing a macro without removing others (2000 / 2003)

    Hi All,

    If I was to copy my vba macros into the VBA of a document (not the normal.dot) would it be possible for a user to open the document and click a button that will copy the VBA code from the document into the normal.dot of the user without removing any of their exsiting macros.

    Is it also possible to turn on references to things like Microsoft DAO 3.6 using VBA

    Many thanks
    Regards
    Gerbil (AKA Kevin)

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Installing a macro without removing others (2000 / 2003)

    I would think that it is possible although I have never tried to do this
    Mr Excel shows an example of doing this in Excel and the same method should work for Word.
    Copy_modules_from_one_workbook_to_another_using_VB A_in_Microsoft_Excel shows a cleaner example again in Excel.

    You won't be removing their existing macros unless they already have a module with with same name. Also you may need to check that no functions or macros with the same name exist within the modules too.

    Can you use Late Binding instead of turning on References? It might be quite problematic getting that to work programmatically although this link shows you code to do this Add_references_programmatically_with_VB_or_VBA
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Installing a macro without removing others (2000 / 2003)

    Many thanks

    This was great. I have gone with exporting the modules into a shared location, and sending an email attachment of a word document to import the modules. Just got to figure out how to make it import to there normal.dot and not into the document I sent.

    Many thanks
    Regards
    Gerbil (AKA Kevin)

Posting Permissions

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