ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copying a workbook with custom toolbar assigned to a macro (https://www.excelbanter.com/excel-discussion-misc-queries/11571-copying-workbook-custom-toolbar-assigned-macro.html)

Matt W

Copying a workbook with custom toolbar assigned to a macro
 
I created a workbook with a macro that copies data from one of the sheets up
to our server. I have this macro assigned to button on a custom toolbar.
When I copy the workbook and rename it, clicking the button on the custom
toolbar opens the original workbook and runs that macro from that one. I
don't like that. How do I get it to run the one in my new workbook?

-Matt

Dave Peterson

Instead of customizing the toolbar manually, build the toolbar when the workbook
opens (have it point at the workbook that owns that code) and then have that
workbook clean up after itself when you close the workbook.

Here's the shell that I keep.
http://groups.google.co.uk/groups?th...5B41%40msn.com

Matt W wrote:

I created a workbook with a macro that copies data from one of the sheets up
to our server. I have this macro assigned to button on a custom toolbar.
When I copy the workbook and rename it, clicking the button on the custom
toolbar opens the original workbook and runs that macro from that one. I
don't like that. How do I get it to run the one in my new workbook?

-Matt


--

Dave Peterson


All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com