ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Button reference (https://www.excelbanter.com/excel-programming/380906-macro-button-reference.html)

Greg Franke[_2_]

Macro Button reference
 
I have a VBA macro (macro1) in "Master.xls" in which I created a button to
run the macro.
The macro runs and does it's thing. When it is done I do a File Save-As
"Test.XLS". I exit Excel and DO NOT save changes to "Master.xls" (I have
made it read-only).

I re-open "Master.xls" and click the button I created previously. For some
reason the button now references "Test.xls!Macro1". I want this button to
ALWAYS run the macro from "Master.xls". I have tried changing the marco
reference to "Master.xls!macro1".

I can not make this reference static for some reason.
Can it be done?




OKROB

Macro Button reference
 
Is the button on a command bar, or on a sheetin Master.xls?


Greg Franke wrote:
I have a VBA macro (macro1) in "Master.xls" in which I created a button to
run the macro.
The macro runs and does it's thing. When it is done I do a File Save-As
"Test.XLS". I exit Excel and DO NOT save changes to "Master.xls" (I have
made it read-only).

I re-open "Master.xls" and click the button I created previously. For some
reason the button now references "Test.xls!Macro1". I want this button to
ALWAYS run the macro from "Master.xls". I have tried changing the marco
reference to "Master.xls!macro1".

I can not make this reference static for some reason.
Can it be done?



Greg Franke[_2_]

Macro Button reference
 
Thanks for the response.

The button is on a command bar.
Should I try to embed it in a worksheet?

"OKROB" wrote in message
ups.com...
Is the button on a command bar, or on a sheetin Master.xls?


Greg Franke wrote:
I have a VBA macro (macro1) in "Master.xls" in which I created a button

to
run the macro.
The macro runs and does it's thing. When it is done I do a File Save-As
"Test.XLS". I exit Excel and DO NOT save changes to "Master.xls" (I have
made it read-only).

I re-open "Master.xls" and click the button I created previously. For

some
reason the button now references "Test.xls!Macro1". I want this button

to
ALWAYS run the macro from "Master.xls". I have tried changing the marco
reference to "Master.xls!macro1".

I can not make this reference static for some reason.
Can it be done?






All times are GMT +1. The time now is 05:35 PM.

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