我现在面临性能问题,同时读取/自/至MS-Excel单元格中写入数据。我使用的MS Excel 11.0对象库自动化与VB.NET。
I am facing performance issues while reading/writing data from/to MS-Excel cells. I am using MS Excel 11.0 object library for automation with VB.NET.
目前需要花费太多的时间来阅读和/到Excel文件编写。 (10分钟阅读1000行:(),看来细胞通过细胞的阅读和写作的方式是不是effiecient。有没有办法使用批量操作来读/写数据?
Currently it takes too much time to read and write from/to Excel files. (10 mins to read 1000 rows :( ). It seems the cell-by-cell reading and writing approach is not that effiecient. Is there any way to read/write data using bulk operation?
推荐答案
而不是读细胞通过细胞,你可以阅读的整个范围,并将其保存到一个二维arrray。然后,您可以访问二维数组,你会访问Excel单元格。
Rather than reading cell by cell you could read a whole range and save it into a 2D arrray. You can then access the 2D array as you would access a cell in excel.
我不精通VB.NET为Excel对象,但如果你了解C#,然后给这个链接快速阅读,并试图执行它。
I'm not well versed in VB.NET for excel objects but if you understand C# then give this link a quick read and try to implement it.
http://dotnetperls.com/excel-interop 阅读获得工作簿的数据部分
http://dotnetperls.com/excel-interop Read the "Getting workbook data" section
相关推荐
最新文章