View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Karen53 Karen53 is offline
external usenet poster
 
Posts: 333
Default VBA Open Wkbook Disabling Macros

Thanks, Ron.

It works. The problem is it is stopping the macros in the calling workbook
as well. Can I stop only the macros in the newly opened workbook? Is it
possible?

---
Thanks for your help.
Karen53


"Ron de Bruin" wrote:

Hi Karen

Look in the VBA help for

Application.AutomationSecurity = msoAutomationSecurityForceDisable

Then open the file

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Karen53" wrote in message ...
Hi Ron,

Thank you for the reply.

Sorry, I wasn't clear with what I needed.

The workbook being opened comes up with the security window asking to
'Enable' or' Disable Macros'. I need to select 'Disable' with vba.
Application.EnableEvents is already false. Is there a way to do this?
--
Thanks for your help.
Karen53


"Ron de Bruin" wrote:

If you want to stop the events from running when you open a workbook with code you can use

Application.EnableEvents = False

Code

Application.EnableEvents = True


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Karen53" wrote in message ...
Hi,

I need to open a workbook with VBA and disable the macros. How would I do
this?

Workbooks.Open("C:\Documents and Settings\Me\Desktop\New
Workbooks\MywkBook.xls")
--
Thanks for your help.
Karen53