提高MS Excel的写作成绩 [英] Improve performance of MS Excel writing

查看:232
本文介绍了提高MS Excel的写作成绩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在面临性能问题,同时读取/自/至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

这篇关于提高MS Excel的写作成绩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆