![]() |
Commandbutton
Ladies and Gentlemen,
I have a macro button that is installed when the my workbook opens. Click on the button and viola, the macro executes. I would like to have this macro reside in my personal.xls file. Therefore, I copied it over and closed the original workbook. However, when I click the button, the first workbook, which is now closed, opens and the code executes on that workbook. How would I make the button run "macro1" no matter which workbook is open I want it to find the first and only occurance of macro1 among the open workbook(s) and execute that one? Thanks in advance, David Fixemer |
Commandbutton
Is there a hard coded file directory path in your macro coding? If so, change it to the correct path for the second file.
----- David Fixemer wrote: ---- Ladies and Gentlemen I have a macro button that is installed when the my workbook opens. Click on the button and viola, the macro executes I would like to have this macro reside in my personal.xls file. Therefore, I copied it over and closed the original workbook. However, when I click the button, the first workbook, which is now closed, opens and the code executes on that workbook. How would I make the button run "macro1" no matter which workbook is open I want it to find the first and only occurance of macro1 among the open workbook(s) and execute that one Thanks in advance David Fixeme |
Commandbutton
David,
Is the button being installed on that workbook only, and is it destroyed when that WB is closed? The button probably still points at the old WB, so you will need to add installation code to Personal.xls, but be sure to make it a temporary control -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "David Fixemer" wrote in message ... Ladies and Gentlemen, I have a macro button that is installed when the my workbook opens. Click on the button and viola, the macro executes. I would like to have this macro reside in my personal.xls file. Therefore, I copied it over and closed the original workbook. However, when I click the button, the first workbook, which is now closed, opens and the code executes on that workbook. How would I make the button run "macro1" no matter which workbook is open I want it to find the first and only occurance of macro1 among the open workbook(s) and execute that one? Thanks in advance, David Fixemer |
All times are GMT +1. The time now is 12:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com