By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,680 Members | 1,710 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,680 IT Pros & Developers. It's quick & easy.

Automating Excel 97 and Excel 2000

P: n/a
The following C# lines of code work fine with Excel 2000:-

ExcelApplication excelApplication = new Excel.Application();
ExcelWorkbook excelWorkbook =
excelApplication.Workbooks.Add(System.Reflection.M issing.Value);

The second line fails when it is rebuilt with the Excel 97 type library and
run on Excel 97. The error is an InteropServices.COMException and the
message is "The server threw an exception" which is a bit too generic to
give anything useful. The COMPlusExceptionCode is -532459699 and the HResult
is -214741851. Changing the parameter to this:-

ExcelWorkbook excelWorkbook =
excelApplication.Workbooks.Add(Excel.XlSheetType.x lWorksheet);

makes no difference. Even the following line causes the same exception:-

excelApplication.Workbooks.Add(Excel.XlSheetType.x lWorksheet);

Any ideas ?

Nick Carter
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.