ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to prevent vba code from running? (https://www.excelbanter.com/excel-programming/401254-how-prevent-vba-code-running.html)

kfng

How to prevent vba code from running?
 
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!

JP[_3_]

How to prevent vba code from running?
 
Can you locate the workbooks and just delete the code?



HTH,
JP

On Nov 16, 4:57 pm, kfng wrote:
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!



Fred Holmes

How to prevent vba code from running?
 
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???


On Fri, 16 Nov 2007 13:57:01 -0800, kfng
wrote:

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!



ron b

How to prevent vba code from running?
 
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

"kfng" wrote:

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!



All times are GMT +1. The time now is 05:18 PM.

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