Office Powerpoint VSTO Add-in: slide.Shapes.AddOLEObject fails unpredictably when using downloaded local file

StefanBollhalder-4009 0 Reputation points
2026-11-19T08:59:07.0233333+00:00

Hello everyone

 

We have a PowerPoint VSTO-add-in that downloads a OLE Object (Excel) and stores it locally before embedding it into a PowerPoint slide using the currentSelection.InlineShapes.AddOLEObject / slide.Shapes.AddOLEObject method.

 

The file is successfully downloaded and exists on the local filesystem. The add-in uses a local file path as the source for AddOLEObject.

 

 

Observed Behavior:

 

• slide.Shapes.AddOLEObject fails when attempting to add the downloaded file as an OLE object.

• The file is stored in a local temporary folder with Defender Exclusion.

• As a troubleshooting step, we also tested with a different local folder that is excluded from Microsoft Defender Antivirus scanning.

• The issue occurs regardless of whether the file is located in the temporary folder or the Defender-excluded folder.

 

 

Expected Behavior:

 

• PowerPoint should successfully insert the downloaded file as an embedded OLE object using slide.Shapes.AddOLEObject.

 

 

Environment:

• VSTO Add-in

• Microsoft PowerPoint and Windows 11

• File downloaded and stored locally before calling AddOLEObject

• Windows Defender exclusion tested without resolving the issue Troubleshooting

• Verified that the file exists locally and is accessible.

• Tested multiple local folders on multiple user devices.

• Tested a folder excluded from Microsoft Defender Antivirus.

• Confirmed that the failure occurs after the download completes and the file is present on disk

 

 

Has anyone encountered similar behavior with OLE objects in combination with a VSTO add-in? Any insight into the underlying cause or recommendations for further debugging would be highly appreciated.

 

Thanks in advance

Microsoft 365 and Office | Development | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Heimerdinger 1,805 Reputation points Independent Advisor
    2026-11-19T12:10:12.9733333+00:00

    Hi @StefanBollhalder-4009,

    Thank you for providing the detailed information and for sharing the troubleshooting steps you have already tried.

    In this case, I would recommend also posting your question in the Microsoft Tech Community, where Microsoft engineers, MVPs, and other developers may have experience with similar VSTO and OLE scenarios.

    Microsoft Tech Community– a good place to discuss Microsoft 365 and SharePoint/OneDrive development scenarios with community experts, MVPs, and Microsoft contributors.

    When posting, I would suggest including the relevant portion of your Shapes.AddOLEObject code and the exact exception, error message, or HRESULT returned when the operation fails. This may help others investigate the behavior more accurately.

    I apologize for redirecting you to another community. Since I do not have the specific technical knowledge required to properly troubleshoot this code, I would rather not provide advice that could be misleading.

    Thank you again for your time and understanding. While my response may not resolve the issue immediately, I hope the Microsoft Tech Community can provide more specialized insight into the behavior you are experiencing.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.