How to prevent vba code from running?

G

Guest

I used some very simple vba codes to automatically save a file to several new
locations on a server after editing as a private sub in WorkBook_BeforeClose
event. It works ok but the vba codes were also saved in the final output
workbooks. Is there anyway I can disable the codes from running in the
output files? Basically, I want the codes to stop running in the output file
without "disabling macro" when Excel is launched. The users are not that
computer savy and got scared when they see the disable/enable macro box
popping up.

Thanks!
 
F

Fred Holmes

If the distribution copies of the workbook will never use the macros,
keep the macros in your PERSONAL.XLS or in another separate workbook
that you load when you personally are working with the distribution
workbook???? Or just delete the macro module in the distribution
version of the workbook???
 
G

Guest

Or in the workbook open section add a piece of code to check for the name of
the workbook

if activeworkbookname = "Master" then
call <your procedure>
endif
 

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