I am trying to find out why the object of Microsoft PowerPoint application doesn't want to open pptx file. This is what I have (C#):
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using MSBool = Microsoft.Office.Core.MsoTriState;
private void button2_Click(object sender, EventArgs e)
{
PowerPoint.Application oPowerPointApp = new PowerPoint.Application();
oPowerPointApp.Activate();
oPowerPointApp.Visible = MSBool.msoTrue;
oPowerPointApp.Presentations.Open("c:\\mypp\\pptx001.pptx");
}
I am getting this exception when Open method is been called: **System.Runtime.InteropServices.COMException: 'Error HRESULT E_FAIL has been returned from a call to a COM component.' **
I have Microsoft 365 MSO (Version 2211 Build 16.0.15831.20220) 64-bit
Windows 10 64 bit
MSExcel application works just fine. I am wondering if somebody had this kind of issues and have a solution. Any help would be greatly appreciated.
I tried to:
- Tweak values of DCOM for Microsoft PowerPoint previewer (Security and Identity tabs)
- Reinstall PowerPoint (MS Office)
- Call to Open method with all kinds of different combinations of arguments
- Install Nuget package Microsoft.office.Interop.PowerPoint