|
|
|
date: Fri, 7 Mar 2008 07:47:05 -0800,
group: microsoft.public.excel.interopoledde
back
Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
Hi,
I created an application using C# in Visual Studio 2008. The application
gets all the data from the Microsoft Projects Planner (MPP) file and then
after some complex calculations save some figures to Excel file. I am using
Microsoft Interop Assemblies 11 for accessing the Projects and Excel.
The application works fine on Windows Vista. But it fails on Windows 2000
with the following error:
Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed because
the QueryInterface call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
The softwares installed in my Windows Vista machine are as follows:
MS-Office 2007 (Excel, Projects Standard, Access, Outlook)
Windows 2000 Machine is equipped with the following:
MS-Office 2003 (Excel, Projects Standard, Access, Outlook)
The code for saving the values to the excel file is as follows:
using MSExcel = Microsoft.Office.Interop.Excel;
MSExcel._Application msExcel = new MSExcel.Application();
ProjectProgressChartOutputMapper projectProgressChartOutputMapper = new
ProjectProgressChartOutputMapper();
mppFolderName = mppFolderName + "graphplotingcoordinates.xls";
//------------------------------------
//Code fails at this line
//------------------------------------
MSExcel.Workbook msExcelWorkbook =
(MSExcel.Workbook)(((MSExcel._Application)msExcel).Workbooks.Open(mppFolderName,
Type.Missing, false, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing));
The same code works perfectly in WIndows Vista. Also I had taken the
references of Office Interop Assemblies 11 (Not 12.0)
--
Thanks
-Ashish Sharma
date: Fri, 7 Mar 2008 07:47:05 -0800
author: Ashish Sharma
RE: Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
How do i fix the same error message you have. I do not know how to enter a
code. Is there a link?
I am trying to get my database to export to excel and I get the same error
message listed. I have done this many times, but just got the message today.
"Ashish Sharma" wrote:
> Hi,
>
> I created an application using C# in Visual Studio 2008. The application
> gets all the data from the Microsoft Projects Planner (MPP) file and then
> after some complex calculations save some figures to Excel file. I am using
> Microsoft Interop Assemblies 11 for accessing the Projects and Excel.
>
> The application works fine on Windows Vista. But it fails on Windows 2000
> with the following error:
>
>
> Unable to cast COM object of type
> 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
> 'Microsoft.Office.Interop.Excel._Application'. This operation failed because
> the QueryInterface call on the COM component for the interface with IID
> '{000208D5-0000-0000-C000-000000000046}' failed due to the following error:
> No such interface supported (Exception from HRESULT: 0x80004002
> (E_NOINTERFACE)).
>
>
> The softwares installed in my Windows Vista machine are as follows:
>
> MS-Office 2007 (Excel, Projects Standard, Access, Outlook)
>
>
>
> Windows 2000 Machine is equipped with the following:
>
> MS-Office 2003 (Excel, Projects Standard, Access, Outlook)
>
>
>
>
> The code for saving the values to the excel file is as follows:
>
>
> using MSExcel = Microsoft.Office.Interop.Excel;
>
>
> MSExcel._Application msExcel = new MSExcel.Application();
> ProjectProgressChartOutputMapper projectProgressChartOutputMapper = new
> ProjectProgressChartOutputMapper();
>
>
> mppFolderName = mppFolderName + "graphplotingcoordinates.xls";
>
>
> //------------------------------------
> //Code fails at this line
> //------------------------------------
>
> MSExcel.Workbook msExcelWorkbook =
> (MSExcel.Workbook)(((MSExcel._Application)msExcel).Workbooks.Open(mppFolderName,
> Type.Missing, false, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
> Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
> Type.Missing, Type.Missing, Type.Missing));
>
>
>
>
> The same code works perfectly in WIndows Vista. Also I had taken the
> references of Office Interop Assemblies 11 (Not 12.0)
>
>
> --
> Thanks
> -Ashish Sharma
date: Wed, 9 Jul 2008 20:33:01 -0700
author: Karyn
|
|