Trouble opening new Excel Document using c# (Office 2000)

A

Antonello

Hi all,
I have a problem trying to open a new excel workbook in my office apps.
All works fine if I use office 2003 (libraries 11.0)

I tried to convert the application on office 2000, using libraries Excel 9.0
and Office 9.0, creating also a "clean app" only to test, with the following
code:

Excel.ApplicationClass esd = new Excel.ApplicationClass();
object miss = Type.Missing;
esd.Workbooks.Open("test.xls",miss,miss,miss,miss,miss,miss,miss,miss,miss,miss,miss,miss);
esd.Visible = true;

but when try to open workbook the application hungs up at rows n°3 with the
following exception:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in myTestApp.exe

Additional information: old format or library type not valid.

Any idea about?
Thanks in advance to anyone can help.

--Antonello
 
C

Cindy M.

Hi =?Utf-8?B?QW50b25lbGxv?=,
I have a problem trying to open a new excel workbook in my office apps.
All works fine if I use office 2003 (libraries 11.0)

I tried to convert the application on office 2000, using libraries Excel 9.0
and Office 9.0, creating also a "clean app" only to test, with the following
code:

Excel.ApplicationClass esd = new Excel.ApplicationClass();
object miss = Type.Missing;
esd.Workbooks.Open("test.xls",miss,miss,miss,miss,miss,miss,miss,miss,miss,miss,miss,miss);
esd.Visible = true;

but when try to open workbook the application hungs up at rows n°3 with the
following exception:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in myTestApp.exe
Did you check the Open method in the Excel 9.0 object library? It will have a different
number of optional parameters, so the same solution won't work with 9.0 as with 11.0.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top