开发者

Editing Excel without opening and closing by Excel Engine

Is there a way to read Microsoft Excel file without opeining it? Opening and closing excel files are very slow operations indeed. In my program I want 开发者_StackOverflow社区to edit 17 excel files at once and save them.

Please help


By "opening an Excel file" and commenting that it's very slow you are presumably opening it in Excel - which you shouldn't be. Find yourself a library for working with Excel files, there are plenty around, some third party, some by Microsoft, and work with the files but not by automating the program. The later formats (2007 onwards) use (zipped) XML, which can be read/modified directly.

Search StackOverflow for existing questions on Excel and you'll find hundreds/thousands.

This one looks a promising link, gleaned from here - https://stackoverflow.com/questions/170652/whats-the-best-net-library-for-parsing-and-generating-excel-spreadsheets

http://www.carlosag.net/Tools/ExcelXmlWriter/


I assume you are opening your files using Excel interop, which is slow. If your files are Excel 2007 or above, you can create or edit files using the free Microsoft Open XML SDK. It takes advantage of the fact that Office documents in versions 2007 and above are essentially zipped xml files, and provides an API to simplify working with these documents, without requiring Excel itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜