Protect a maco in master copy

D

dswiders

I have a macro that is run in a workbook that is the master copy.
When the macro runs I have the user enter a new name to save the
file. Once this happens the original macro is transferred to the new
file, is there a way to protect this code so that it stays in the
master copy and also transfers to the new workbook as well?
 
E

Earl Kiosterud

The key is where the macro lives. If it's in the master workbook, and that workbook is
saved, the macro will also live in the saved workbook. It the macro is in another workbook
(Personal.xls, or any other workbook), it won't be saved.

--
Earl Kiosterud
www.smokeylake.com

Note: Some folks prefer bottom-posting. But if you bottom-post to a reply that's already
top-posted, the thread gets messy. When in Rome.
 
J

JE McGimpsey

That's what's happening now, unless the macro specifically deletes the
code in the template.

If that code exists, delete it.
 

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