#2
厨师王德榜2018-05-24 22:04
|
各位大神,请教一个问题。VB2010如何对excel进行逐行读取?
AppXls = New Microsoft.Office.Interop.Excel.Application '实例化Excel对象
AppXls.Workbooks.Open(TuikaExcel) '打开已经存在的EXCEL文件
AppXls.Visible = True '使Excel不可见
AppWokBook = AppXls.Workbooks(1) 'AppWokBook对象指向工作簿"*:\*.xls"
AppSheet = AppWokBook.Sheets(1) 'AppSheet对象指向AppWokBook对象中的表“Sheet3”,即:"*:\*.xls"中的表“Sheet3”
index1 = IO.File.ReadAllText(indexFile, System.Text.Encoding.Default)
x = x + index1
Dim intlastcolnum = AppSheet.UsedRange.Columns.Count
Dim intlastrownum = AppSheet.UsedRange.Rows.Count