I have a Visual C++ MDI application that can open Excel documents in place. I imported the class files from the Excel type library and use CreateFromFile to return an IDispatch pointer for the Workbook that was open. From there I can perform automation tasks such as filling in cells, etc. I also use the Workbook.GetApplication call to return the Application IDispatch pointer and have been able to run macros.

The problem is when I run a macro from within the Excel in-place document, the DisplayAlerts property can't be set. When I open up the same file directly from Excel and run the same macro that sets DisplayAlerts, it works fine. The following is also the case:

From the automation document: Tools -> Macro -> Run
(Application.DisplayAlert = False fails)
From the document: Tools -> Macro -> Edit (and then from within the VBA editor I run the macro)
(Application.DisplayAlert = False works)

The error I get is: Runtime error 1004 - Method DisplayAlerts of object _Application failed.

I can't think of anything else to try. Thanks.

Mike S.