Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts

    Macro storage location (Excel 2003)

    Greetings loungers
    I have a procedure stored in module1 of an excel template.

    A customised toolbar has a button assigned to that routine.

    IT would appear that when I create a new file based on the template the macro assignment to the button becomes filename1.xls!macroName.

    As soon as the button is pointed back to the macro stored in the template all is well. ?

    Storing the routine in the personal workbook is a work around but I only want this routine to be available to files based on the template.

    What am I missing ?

    Regards
    Geof

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

    Re: Macro storage location (Excel 2003)

    Unlike in Word, there is no link at all between an Excel workbook and the template it was created from. If an Excel template contains VBA code, this code will be copied into each workbook created from the template. So the toolbar button should work if it runs the macro in the new workbook.

    I usually create and delete custom toolbars in code. See the attached example.

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Macro storage location (Excel 2003)

    In addition to Hans' attachment you might want to read thru the thread: Distributing an Excel application with toolbars (5/95/97/2000/2002)

    I think it has some examples and might help you understand what excel is doing.

    Hope this helps,
    Steve

  4. #4
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts

    Re: Macro storage location (Excel 2003)

    Hans
    Thank you very much for your assistance.
    Rregards
    Geof

  5. #5
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    324
    Thanks
    9
    Thanked 28 Times in 26 Posts

    Re: Macro storage location (Excel 2003)

    Thanks for the tips Steve.
    Geof

Posting Permissions

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