Ashish Sharma
2008-03-07 15:47:05 UTC
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)
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
Thanks
-Ashish Sharma