View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
Joseph Geretz Joseph Geretz is offline
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