敬请各位高手解决以下问题:vb.net(vs2010)读取Excel区域的数据如何分离?谢谢
以下是(vs2010)的代码,在倒数第二行处出错,有什么代码把arr一个一个地取出?在网上看到用ADO(vs2010的)可以,但赋值时还是整体赋值的?(vs2010)的代码已经不行,
用ADO(vs2010的)可以把arr一个一个地取出吗?Excel是2003
Dim xlapp As Object = CreateObject("Excel.Application")
Dim xlBook As Object = xlapp.Workbooks.Add
Dim slSheet1 As Object = xlBook.Worksheets(1)
Dim slSheet2 As Object = xlBook.Worksheets(2)
Dim slSheet3 As Object = xlBook.Worksheets(3)
xlapp.Visible = True
Dim i As Integer, j As Integer, k As Integer, arr
With slSheet1
For i = 1 To 9
.range("c" & i + 2) = i
.range("f" & i + 8) = i + 8
Next
j = .cells.find("*", , , , 1, 2).row
k = .cells.find("*", , , , 2, 2).Column
arr = .range(.cells(3, 3), .cells(17, 6))
.range("h9").Resize(15, 4) = arr '这里出错
End With
[此贴子已经被作者于2017-6-22 19:32编辑过]