Posts by RetepV

    Hi, I have an application, that opens Word and embeds an Excel.Sheet object in the page. It does this by doing the following call:

    objWordInlineShape = objWordDocument.Range(nStart).InlineShapes.AddOLEObject("Excel.Sheet.8", strExcelFileName)

    However, the Excel file contains macro's and I get a warning message about this (which I obviously don't want :)).

    Now, I know there is a DisplayAlerts property in the Excel Application object, but I don't have an Application object before calling AddOLEObject. And I cannot seem to first create the inlineshape (empty Workbook object), then get the Application object through it, set the DisplayAlerts property and only then opening the file.

    Of course, I could disable the warning message in Excel, but I'd rather not.

    Does anyone have any suggestions to suppress these warning messages programmatticaly?

    I would like to use an embedded Excel object, because that way I can scale the Excel document to the page width.