- Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook =
App.WorkBooks.Open("D:\Report.xls")
Dim Ws As MSExcel.WorkSheet =
Wb.WorkSheets(1)
Dim Rg As MSExcel.Range =
Ws.UsedRange
MessageBox.Show(Rg.Rows.Count)
MessageBox.Show(Rg.Columns.Count)
MessageBox.Show(Rg.Count)
App.Quit
- Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook =
App.WorkBooks.Open("D:\Report.xls")
Dim Ws As MSExcel.WorkSheet =
Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.Range("A2")
Rg =
Rg.Offset(5,3)
MessageBox.Show(Rg.Address)
App.Quit
我想动态引用单元格,怎么表示呀,比如 Ws.Range("A&Rg.Columns.Count") 我知道不对,但是该怎么写呀