Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default 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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default 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!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hide/protext auto_open code so user can't prevent it from running Scott Excel Programming 4 May 18th 07 04:40 PM
how to prevent code running when in a worksheet code Corey Excel Programming 5 August 13th 06 08:52 AM
Prevent code in "Sheet Activate" from running when sheet made visible from other macr Simon Lloyd[_794_] Excel Programming 10 June 21st 06 09:15 AM
Prevent others from running my macros Frederick Chow Excel Programming 2 December 13th 05 06:02 PM
Prevent Excel crash when running rauxalacch[_2_] Excel Programming 1 November 18th 05 06:07 AM


All times are GMT +1. The time now is 02:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"