Trying to cope up with HRESULT E_FAIL error that I keep getting while trying to open a powerpoint file. There is more to code but the very basic operation for which I get the error is shown in the code block below. Reference DLLs being used are: Office 14.0.0 and Microsoft.Office.Interop.Powerpoint 14.0.0.
Application application = new Application { DisplayAlerts = PpAlertLevel.ppAlertsNone };
Presentation powerpoint = application.Presentations.Open(@"X:\XXX\xxx.pptx");
powerpoint.SaveAs(@"X:\XXX\saved.pdf", PpSaveAsFileType.ppSaveAsPDF, MsoTriState.msoTrue);
It's a very basic operation, but not sure why it's complaining about the COM Exception. Microsoft Office 2010 32-bit with Service Pack 1 is installed on the machine.
I had the same exact problem. I have searched for the solution for a few day. At last I found it.
When you install MS Office 2010, you should install "Office Shared Features" with Powerpoint in Office CD together. After installing "Office Shared Features", everything is OK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With