LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 32
Default How do I prevent AutoRun Macros when Programmatically Opening Workbook?

I have an application which uses Word and Excel as automation servers. When
opening a document, I need to prevent macros from running automatically.

For Word documents I can do this as follows:

m_AppWord.WordBasic.DisableAutoMacros 1
Set m_DocWord = m_AppWord.Documents.Open(CStr(m_Document), False, True,
False)

What is the equivalent statement for Excel which I should be coding directly
before opening the file?

Set m_DocExcel = m_AppExcel.Workbooks.Open(CStr(m_Document))

Thanks for your help!

- Joseph Geretz


 
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
Disable macros on a programmatically opening .xls file Matt[_2_] Excel Discussion (Misc queries) 2 May 25th 07 04:45 AM
how do I prevent a file from opening if user has disabled macros? mwh1107 Excel Programming 2 May 26th 05 11:50 PM
Disable Macros in workbook programmatically quartz[_2_] Excel Programming 2 April 2nd 05 03:31 AM
How do I turn off macros when programmatically opening a workbook. PhilBerkhof Excel Programming 3 December 10th 04 09:55 PM
autorun code when opening sheet (not workbook) Steve Mutambo Excel Programming 3 April 2nd 04 04:46 PM


All times are GMT +1. The time now is 12:45 PM.

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"