COleDocObjectItem fails Office 365/2024 even trusted & MOTW removed
04:47 31 Jan 2026

I am working with Office 365 / Office 2024 and an MFC C++ application.
My app originally worked fine with Office 2021, but when upgrading to Office 365 or Office 2024, I encounter the following error (see attached screenshot).

I have already tried the following steps:

  1. Added the file path to Trusted Locations and enabled macros (opening the file directly works fine).

  2. Removed Mark of the Web from the entire source folder.

However, the error still occurs.

Source code:
COleDocObjectItem *pItem;

pItem->CreateFromFile();
pItem->Activate(OLEIVERB_SHOW, CViewControl); -> The CViewControl object is always valid, and in Office 2021 this code works correctly.

visual-c++ office365 ole-object