Thread: Disable macro's
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Disable macro's

Try code like the following:

Dim Sec As Long
Sec = Application.AutomationSecurity

Application.EnableEvents = False
Application.AutomationSecurity = msoAutomationSecurityForceDisable
' open the workbook
Application.EnableEvents = True
Application.AutomationSecurity = Sec


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"TJ" wrote in message
...
Hi

I am currently writing a procedure that opens another workbook using
Workbooks.Open.. The workbook that is being opened contains macros which I
want disabling. Is there anyway to stop this? I am using Excel 2003

Thanks
TJ