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

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Macros assigned to toolbar buttons (2k with windows 2k)

    Author
    Topic
    #419943

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #949610

      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.

    • #949665

      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.

      • #949757

        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?

      • #949758

        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?

    Viewing 1 reply thread
    Reply To: Macros assigned to toolbar buttons (2k with windows 2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: