Wednesday, 9 July 2014

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Workbook'



I just created an Application and I Hosted in IIS 7.5. 

I am instantiated the excel object then am getting Error Like this


Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Workbook'. This operation failed
because the QueryInterface call on the COM component for the interface with IID '{000208DA-0000-0000-C000-000000000046}' failed due to the
following error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).


//Create instance to Excel workbook to work with chart data
Microsoft.Office.Interop.Excel.Workbook dataWorkbook = (Microsoft.Office.Interop.Excel.Workbook)chartData.Workbook;


To Resolve this Issue you have to Office run-time Installed on the Server.
and  Com+ Configuration settings and Permissions i Explained in the My previous Post
for  Microsoft Excel Application.

 

No comments:

Post a Comment