Remove macros in xls file, but keep macros in xlt file

N

nulad

I have a "Master" Excel template ".xlt" that contains macros to create,
format and protect a new worksheet.

After the "Master" "xlt" file is opened, and used to create, format,
and protect a worksheet, the macros are no longer needed or wanted in
the new "xls" file (but the macros are still wanted and needed in the
"Master" "xlt" file). How do you save the resulting "xls" file,
keeping the formatting and worksheet protection, without the "Master"
template's macros?

Is there a macro that can be created, that will not save the macros in
the "xls" file, but will keep the macros in the "Master" template "xlt"
file?
 
C

Chris Marlow

Hi,

You could put your macros in another workbook (preferably XLA) that your XLT
refers to. Your macros would have to cope with the fact that they be executed
on a workbook other than the one they are in.

Although generally this is fairly straightforward, if you have a lot of
recorded macros (in my experience) it could take an amount of reworking to
get the code to work as you expect.

Regards,

Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top