Read Excel Files in C#

  • Thread starter Thread starter =?iso-8859-1?Q?Ivo_Leit=E3o?=
  • Start date Start date
?

=?iso-8859-1?Q?Ivo_Leit=E3o?=

Hi !
My client needs to see excel files in my windows forms
application.I was investigating and i've come across with
some solutions but i was unable to understant if it's
possible to access excel files in a way that is
independent of the office version. The problem is that in
my client enterprise there are computers with office 97,
2000, and xp.
In the windows form application that i have developed, i'm
already accessing excel files through the
Microsoft.Jet.OLEDB.4.0 driver, but now they want to see
in a separate window the original excel file.

It's possible to do this indepent of the version(from 97
to xp)

Tnks, In advance
Ivo Leitão
 
Is Excel going to be on these systems? In that case you can use
ShellExecute() to open them. If they don't have Excel they could download a
viewer possibly?

There are also several third party grid controls that support Excel formats
for display and editing...


+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web


Hi !
My client needs to see excel files in my windows forms
application.I was investigating and i've come across with
some solutions but i was unable to understant if it's
possible to access excel files in a way that is
independent of the office version. The problem is that in
my client enterprise there are computers with office 97,
2000, and xp.
In the windows form application that i have developed, i'm
already accessing excel files through the
Microsoft.Jet.OLEDB.4.0 driver, but now they want to see
in a separate window the original excel file.

It's possible to do this indepent of the version(from 97
to xp)

Tnks, In advance
Ivo Leitão
 
Tnks for your help !
That may be a solution to my problem(all of the computers have excel
installed) but if i need to host the excel sheet inside the winform, i
think that is not possible, it will always open a new window...

Another problem that we are facing is that with Microsoft.Jet.OLEDB.4.0
driver, we are having some problems with the way the excel is being
read. Apparently the driver guesses the types of the columns, for
example if we have 25 rows with numeric values, and the next 25 with
letters the driver, assumes that the type is numeric for all the rows.
We have found that the number of guessed rows is configurable through
the registry, but our client doesn't want to change the registry.
One possible solution to this problem is to configure one parameter of
the connectionstring with IMEX=1 but apparently that is not working.
That's the other reason for me to ask this question, because perhaps we
wil need to change the way we access excel files in the future

The reference links that we have consulted on this question are :
http://support.microsoft.com/default.aspx?scid=kb;EN-US;257819

http://support.microsoft.com/default.aspx?scid=kb;en-us;316934
 
I am not sure about this, but I think you can probably use the Active
Document Server functionality from classic COM days to embed an Excel
spreadsheet in a window. It might be more work than what you are ready to
take on thogh.. :)
 
Back
Top