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 macro's

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Disable macro's

Thanks Chip
"Chip Pearson" wrote in message
...
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




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
Automatically disable macro's on new doc Sarah (OGI) Excel Discussion (Misc queries) 12 August 17th 07 02:19 AM
(Disable macro's while) using the GetObject Max Potters Excel Programming 4 August 19th 04 06:43 PM
Disable AutoOpen macro's Michael Beckinsale Excel Programming 1 October 16th 03 01:48 PM
enable/disable macro's dialog? Trevor Shuttleworth Excel Programming 0 August 19th 03 10:14 PM


All times are GMT +1. The time now is 03:54 AM.

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

About Us

"It's about Microsoft Excel"