Embedded Excel document with Macros blocked by new security rules

Joe Sherry 11 Reputation points
2022-10-28T19:05:42.087+00:00

Regarding some recent security changes discussed in these pages:

https://learn.microsoft.com/en-us/office/troubleshoot/excel/embedded-macros-not-run
https://www.microsoft.com/en-us/security/blog/2016/03/22/new-feature-in-office-2016-can-block-macros-and-help-prevent-infection/

We have spreadsheets embedded in our own data files. We invoke Excel on the spreadsheets via the OLE container mechanism. With the recent changes, spreadsheets with macros are blocked. In the previous versions of Office/Excel, the user was given the option to enable macros. The solution suggested on those URLs is to add Trusted Locations into the Trust Center Settings, but I can add all of the disk drives on my local machine and the macros are still blocked.

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,640 questions
0 comments No comments
{count} vote

4 answers

Sort by: Most helpful
  1. Joe Sherry 11 Reputation points
    2022-11-01T15:17:04.797+00:00

    Hello @Emi Zhang-MSFT ,
    Thanks for the reply. We are using the 365 apps. I had found the link you sent, but it mostly has information about security of files from the web etc.

    What is different about our situation is that we are embedding Excel files in a storage within our own data files (we use structured storage file format). I can create a brand new Excel spreadsheet locally (never been near the Internet), embed it in our data file via this call:
    BOOL COleClientItem::CreateFromFile(LPCTSTR lpszFileName, REFCLSID clsid,
    OLERENDER render, CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc)

    We allow our users to edit that spreadsheet via the "DoVerb" OLE mechanism that automatically invokes the application associated with the file type.
    If the spreadsheet that was embedded contains macros, that invocation no longer succeeds. This is the error dialog:
    256100-image.png

    1 person found this answer helpful.

  2. Emi Zhang-MSFT 21,856 Reputation points Microsoft Vendor
    2022-10-31T02:51:59.143+00:00

    Hi @Joe Sherry ,
    What version of Office are you using?
    If you're using the Microsoft 365 apps, I suggest you refer to this support article to get more information:
    https://learn.microsoft.com/en-us/DeployOffice/security/internet-macros-blocked
    Just checking in to see if the information was helpful. If my understanding is incorrect, please let us know and I'm glad to help you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Joe Sherry 11 Reputation points
    2022-11-03T14:40:20.267+00:00
    1. In the actual workflow, there is no file to check. It is embedded with OLE, and Excel is invoked with DoVerb(), and refuses to open the file
    2. If I manually extract the embedded file into a standalone spreadsheet file, there is no Blocked section in the dialog (as expected, as it did not come from outside the machine).
    0 comments No comments

  4. Neil Cheyne 0 Reputation points
    2023-07-01T05:16:54.7533333+00:00

    I have had a very similar problem with a custom written app that calls Excel via OLE and was giving me the exact same error dialog as you are showing above.

    A work around I found, on another post, was to open a separate macro enabled spreadsheet in Excel first, before starting my custom app. The OLE Container created spreadsheet was then happy, as macros were already enabled, as Excel was already running.

    Another tip is the OLE Container worksheet initially appears both unreadable and uneditable. However, a right click in the sheet gives the choice to "Open" the worksheet. A fully useable Excel version appears for me at that point.

    0 comments No comments