Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Macros assigned to toolbar buttons (2k with windows 2k)

    Hi all,

    I have a question which might have been answered before but was unable to find anything on in a search. I have macros/code assigned to buttons I placed on a toolbar. This code resides in a file I am using as a template. The buttons are used to perform various processes on the file and then do a "save as" process using specific information within the code to develop the name used to save the file. Everything work fine until I try to reuse the template file again. When I go to push the toolbar buttons(the ones I created), Excel has to open the last save file to retrieve the code. This is a problem since many people will use this template and it resides on the network, but not everyone will have access to the last saved file. How do I keep the assigned code/macro to the buttons I placed on the toolbar to stay with the template file only???

    Thanks for any help you can provide.
    Kevin

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

    Re: Macros assigned to toolbar buttons (2k with windows 2k)

    You could build the toolbar in code each time the workbook/template is opened. Or you can place the code in an add-in, see Jan Karel Pieterse's series Create Addins.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros assigned to toolbar buttons (2k with windows 2k)

    To simplify this process, the best thing you can do is to separate the code from the template. Otherwise the code will travel with each and every copy of your template and when you need to update something, you'll have a host of copies that might be containing wrong code.

    Also it will take you quite some planning to keep the toolbar in sync with the template/copy of the template, especially when people are going to (perhaps) open multiple copies of the template file in the same Excel session.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Macros assigned to toolbar buttons (2k with windows 2k)

    Thank You for your suggestion. What is the best way to seperate the code? SHould I just the newtwork containing the code and relate the buttons to the code in that file?
    Kevin

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Macros assigned to toolbar buttons (2k with windows 2k)

    Sorry, reply should read... ...Thank You for your suggestion. What is the best way to seperate the code? SHould I just put a file on the newtwork containing the code and relate the buttons to the code in that file?
    Kevin

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

    Re: Macros assigned to toolbar buttons (2k with windows 2k)

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> You can edit a post or reply by clicking the <IMG SRC=http://www.wopr.com/w3timages/edit.gif> button in the post header.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Macros assigned to toolbar buttons (2k with windows 2k)

    thank you, you gentlemen/ladies do a great service here !!!!!!!!!!!!!!!!!!!!!!!!!
    Kevin

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

    Re: Macros assigned to toolbar buttons (2k with windows 2k)

    You could use a workbook in a network folder accessible to all users, and associate the toolbar buttons with macros in that workbook, or create an add-in (.xla) and let users install that. Pieterse's series about creating an add-in provides useful information, as does <!post=Distributing an Excel application with toolbars (5/95/97/2000/2002),200526>Distributing an Excel application with toolbars (5/95/97/2000/2002)<!/post>.

Posting Permissions

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