Making a macro sustain from next document onwards

R

Raghavendra

Hi all,

I have created a macro in an excel work book. I have assigned this macro to
a new button.
As long as I am in the same work book, this macro works for me with the
button.
But, when I close this work book, and open a new / other work books, the
button exists, but the macro does not exist.

How can I make an macro retain / sustain in any excel workbooks that I open
and get it through the button?

Any help much appreciated.

Thanks,

Raghavendra
 
S

Stefan Hägglund [MSFT]

Hi!

This problem occurs because the macro are stored in the workbook.
You should move the macro to the hidden workbook "Personal.xls" in the
XLSTART folder, using the VBA editor..
The personal macro workbook Personal.xls is a global macro workbook that
Excel typically loads from the XLStart folder in a hidden state.

Best regards

Stefan Hägglund
Microsoft
 
D

Dave Peterson

Is this a button on a toolbar?

When you clicked on that button, didn't excel try to open your workbook with the
macro?
 
R

Raghavendra

Stefan, That worked. Thanks for the help.

Dave, I just wanted the macro to work in whatever the excel work book I open.
Stefan's answer seems to do what I want. Thanks for the initiative.

MNRaghu
 
Top