如何在vb.net中将数据附加到xls电子表格 [英] how to append data to xls spreadsheet in vb.net
本文介绍了如何在vb.net中将数据附加到xls电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我如何将数据附加到vb.net中的现有xls电子表格中.曾经试图做到这一点:oExcel = CreateObject("Excell应用程序"
oBooK = oExcel.workbooks.add
oSheet = oBook.worksheets(1)
我希望能够存储尽可能多的数据,而无需重新创建或覆盖电子表格.我可以在应用程序中插入任何代码来执行此操作吗?
感谢
Hi
How do i append data to an existing xls spreadsheet in vb.net. have tried to do this at one point : oExcel = CreateObject ("Excell Application"
oBooK = oExcel.workbooks.add
oSheet = oBook.worksheets(1)
i want to be able to store as many data as i can without recreating or overwriting the spreadsheet. is there any code i can insert in my application in order to do this?
Thanks
推荐答案
工作表对象具有UsedRange属性,该属性返回一个Range对象,该对象涵盖了工作表中所有已使用单元格的范围.您只需要在范围的最后一行加1即可获得要向其添加数据的下一行.
The Worksheet object has a UsedRange property that returns a Range object encompassing the entire range of used cells in the sheet. You just need to add 1 to the last row of the range to get the next row to add data to.
这篇关于如何在vb.net中将数据附加到xls电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文