Showing posts with label Open Office XML SDK. Show all posts
Showing posts with label Open Office XML SDK. Show all posts

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.

 

Saturday, 28 April 2012

The type 'System.IO.Packaging.Package' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase'.

While i was working with the Open XML SDK 2.0, after i added the reference of  DocumentFormat.OpemXml  assembly and i build the Application I ran into this Error Message.


The type 'System.IO.Packaging.Package' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'


Just add another reference to WindowsBase assembly that is found in the .NET Tab.