2

Is there a way to read in excel (2003) files in .NET without office beeing installed and maybe even without any 3rd party library?

To be able to use VSTO I suppose office needs to be installed, right?

But how about ADO.NET (e.g. Microsoft.Jet.OLEDB.4.0,Extended Properties=Excel 8.0)? Does it require Office beeing installed?

It is also important that I can read in these comments made to a cell:

enter image description here

Kara
  • 6,115
  • 16
  • 50
  • 57
bitbonk
  • 48,890
  • 37
  • 186
  • 278
  • We had a similar problem. In the end, the decision was to force the upgrade from 2003 to 2007 and above. Once you are dealing with 2007 you are dealing with an open format that is easier to deal with. You won't be able to read comments with ADO. – Dom Aug 16 '11 at 10:29

2 Answers2

0

If you can/want to use an open source library there is excellibrary. The library reads and writes Excel 2003 files. As far as I remember you can get into comments. If not - it would be trivial to coded as all record types are already decoded.

You are correct you need Office to be installed on a machine to be able to use VSTO.

As far as I know you will not be able to read comments via ADO.

Juliusz
  • 2,096
  • 2
  • 27
  • 32
0

Without 3rd party libraries and Office things get really difficult and why not say impossible.

If you choose a 3rd party library, go with NPOI. From my experience I can tell that it's pretty good.

To read comments with NPOI, take a look at this sample:

http://www.java2s.com/Open-Source/CSharp/GUI/NPOI/TestCases/HSSF/UserModel/TestHSSFComment.cs.htm

To see how to set a comment in a Cell with NPOI take a look at SetCellCommentInXls project inside the Samples package.

Community
  • 1
  • 1
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480