When I have a macro open another file, it always activates the macros in it. Is there some way to disable the macros?
When I have a macro open another file, it always activates the macros in it. Is there some way to disable the macros?
Last edited by foxguy; 06-30-2009 at 05:42 PM.
This code in your macro should disable other macros from firing until you issue a "TRUE" version later.Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
That will keep events from triggering in the open workbook.
If you don't want macros to be able to run at all in the workbook (e.g., via Alt+F8), then before opening,
Please Login or Register to view this content.
Entia non sunt multiplicanda sine necessitate
replied too soon
Last edited by foxguy; 06-30-2009 at 05:47 PM.
shg;
I tried this code:
and my macro just ended as soon as the file was opened. It never reached the line that reset the AutomationSecurity.Please Login or Register to view this content.
The file opened fine and macros would not run in it, but the security was not reset.
Try this
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Sorry, I copied & pasted in a rush, then made amendments. You don't declare the variable, when I run the code it disables the code within the opened workbook but not the parent workbook.
Roy;
That's the same code I run (I declare the variable, just didn't put it in the reply). But when it opens the workbook, the macro ends. It never executes the line:Please Login or Register to view this content.
Try attaching the workbook, it worked for me in a dummy workbook
How are you running the code as a matter of interest?
Remember what the dormouse said
Feed your head
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks