473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Automating Excel 97 and Excel 2000

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
0 1768

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dean Bortell | last post by:
This code runs fine on win xp and office xp: string sheetPassword = "Senior1993"; string sheetToOpen = "NewRpt1c.xls"; Excel.Application excelApp = new Excel.Application();...
0
by: Laurence | last post by:
Hi Folks hope someone can help me out with this wee problem. I'm automating Excel from A2K and want to put a solid black border around a range of cells. I've tried using this: ...
1
by: Richard | last post by:
All, I am writing an Outlook 2000 Add-In .DLL program. I have applied the necessary knowledge base fixes to enable event handling in Outlook 2000 and everything is working except for one...
17
by: Mansi | last post by:
I need to do some research on how to use excel automation from c#. Does anyone know of any good books related to this subject? Thanks. Mansi
22
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody...
4
by: Supa Hoopsa | last post by:
I am in the process of rewriting an MS Access application (access front end with SQL 2k database) in VB.NET and one of the things I would like to do is link in to the compiled Access ADE so that I...
0
by: David Caissie | last post by:
I am trying to automate a Vb.net chart using the excel COM object. The problem occurs when trying to run the code in different systems. It is working fine under one of my computers but once i move...
0
by: Nick Carter | last post by:
The following C# lines of code work fine with Excel 2000:- ExcelApplication excelApplication = new Excel.Application(); ExcelWorkbook excelWorkbook =...
3
by: saragoesnuts | last post by:
I have a program that automates to Excel with information in tables. I want to add charts to the excel file (pie charts, bar charts, etc). Is this possible?
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.