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:开发者_StackOverflow社区
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.
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.
精彩评论