Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Disable Macros through VBA

HI,

I am trying to save as an excel workbook with macros but when the user
will open it after the save as i dont want the macros to work.

I have a form that kicks in in the Workbook_Open event, i dont want
this event to occur after the save as.

I know about Application.EnableEvents=False but if i use it it will
disable the macros all the time, i need to disable it only when the
user opens the copy after the save as.
I googled for it but couldnt find anything.

Thanks,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Disable Macros through VBA

Why not just set a flag in the code after the save that gets tested in the
macros, and the exit immediately if set.

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
HI,

I am trying to save as an excel workbook with macros but when the user
will open it after the save as i dont want the macros to work.

I have a form that kicks in in the Workbook_Open event, i dont want
this event to occur after the save as.

I know about Application.EnableEvents=False but if i use it it will
disable the macros all the time, i need to disable it only when the
user opens the copy after the save as.
I googled for it but couldnt find anything.

Thanks,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Disable Macros through VBA

Bob,

Do you mean like testing the content of a cell or something?

Thanks,

On Jan 28, 7:27 pm, "Bob Phillips" wrote:
Why not just set a flag in the code after the save that gets tested in the
macros, and the exit immediately if set.

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in oglegroups.com...



HI,


I am trying to save as an excel workbook with macros but when the user
will open it after the save as i dont want the macros to work.


I have a form that kicks in in the Workbook_Open event, i dont want
this event to occur after the save as.


I know about Application.EnableEvents=False but if i use it it will
disable the macros all the time, i need to disable it only when the
user opens the copy after the save as.
I googled for it but couldnt find anything.


Thanks,- Hide quoted text -- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Disable Macros through VBA

No, what I was referring to was a public global variable. I was suggesting a
variable as it would automatically re-initialise on next opening. The
problem with using a cell is that you would need to clear it before closing
the workbook.

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
Bob,

Do you mean like testing the content of a cell or something?

Thanks,

On Jan 28, 7:27 pm, "Bob Phillips" wrote:
Why not just set a flag in the code after the save that gets tested in

the
macros, and the exit immediately if set.

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my

addy)

wrote in

oglegroups.com...



HI,


I am trying to save as an excel workbook with macros but when the user
will open it after the save as i dont want the macros to work.


I have a form that kicks in in the Workbook_Open event, i dont want
this event to occur after the save as.


I know about Application.EnableEvents=False but if i use it it will
disable the macros all the time, i need to disable it only when the
user opens the copy after the save as.
I googled for it but couldnt find anything.


Thanks,- Hide quoted text -- Show quoted text -




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
how do i disable macros? whatzzup Excel Discussion (Misc queries) 1 March 14th 06 01:51 PM
disable macros? me[_9_] Excel Programming 1 October 28th 05 11:07 PM
Disable macros Otto Moehrbach[_6_] Excel Programming 0 November 18th 04 03:49 PM
How to disable macros? LenB[_2_] Excel Programming 6 October 6th 03 07:54 PM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


All times are GMT +1. The time now is 08:40 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"