Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2015
    Posts
    23
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Use Macro from External File

    Hi,

    I have 2 working macro when required i have to copy to particular file and run, I seek help if this macro is in file X, is it possible to run in file A.
    The way i am working is tedious copy macro paste in particular file and then run, Please provide a short cut.

    OS Win 7, Office 2013
    Thanks in advance.

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Macros are commonly written to run against whichever document is active. Assuming that is the case here, you could add the macro to whatever template(s) the documents use. That would obviate the need to copy the macro to various documents. Alternatively, you can open any document containing the macro, plus the one you want to run it on, make the latter active then press Alt-F11 and run the macro from within the Visual Basic Editor. Of course, this all pre-supposes the macro does reference the active document and, without seeing your code, no-one can know for sure.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. The Following 2 Users Say Thank You to macropod For This Useful Post:

    Charles Kenyon (2015-10-01),danny69 (2015-10-05)

  4. #3
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts
    You can save macros in document templates (.dotm files) or in global templates. If they are in global templates, they are available to all of your documents. You can, if you want, attach keyboard shortcuts and/or QAT icons to these macros. These would also be stored in the template that holds the macros.
    Charles Kyle Kenyon
    Madison, Wisconsin

  5. The Following User Says Thank You to Charles Kenyon For This Useful Post:

    danny69 (2015-10-05)

Posting Permissions

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