ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove macros in xls file, but keep macros in xlt file (https://www.excelbanter.com/excel-programming/358269-remove-macros-xls-file-but-keep-macros-xlt-file.html)

nulad

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

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?


--
nulad
------------------------------------------------------------------------
nulad's Profile: http://www.excelforum.com/member.php...o&userid=33248
View this thread: http://www.excelforum.com/showthread...hreadid=530713


Chris Marlow

Remove macros in xls file, but keep macros in xlt file
 
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.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Master


"nulad" wrote:


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?


--
nulad
------------------------------------------------------------------------
nulad's Profile: http://www.excelforum.com/member.php...o&userid=33248
View this thread: http://www.excelforum.com/showthread...hreadid=530713




All times are GMT +1. The time now is 06:16 PM.

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