Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Unable to cast COM object of type 'Microsoft.Office.Interop.PowerPoint.ApplicationClass' to interface type 'Microsoft.Office.Interop.PowerPoint._Application

$
0
0

I am using following code to open a ppt file

   Microsoft.Office.Interop.PowerPoint.Application pptApplication = new Microsoft.Office.Interop.PowerPoint.Application();

                //open powerpoint document
                pptPresentation = pptApplication.Presentations.Open((string)originalPptPath,
                                                                    Microsoft.Office.Core.MsoTriState.msoFalse,
                                                                    Microsoft.Office.Core.MsoTriState.msoFalse,
                                                                    Microsoft.Office.Core.MsoTriState.msoFalse);


The problem is it is giving following exception

System.InvalidCastException was unhandled
  Message=Unable to cast COM object of type 'Microsoft.Office.Interop.PowerPoint.ApplicationClass' to interface type 'Microsoft.Office.Interop.PowerPoint._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{91493442-5A91-11CF-8700-00AA0060263B}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
  Source=Microsoft.Office.Interop.PowerPoint

What could be the reason, please suggest



Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
Everything about SQL Server | Experience inside SQL Server-Mohammad Nizamuddin


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>