01.
OpenFileDialog1.Filter =
"Excel Files (*.xlsx,*.xls)|*.xlsx;*.xls"
02.
If
OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK
Then
03.
Dim
address
As
String
= OpenFileDialog1.FileName
04.
Dim
excel
As
New
Excel.Application
05.
Dim
wbook
As
Excel.Workbook = excel.Workbooks.Open(address)
06.
Dim
wsheet
As
Excel.Worksheet =
DirectCast
(wbook.Worksheets(1), Excel.Worksheet)
07.
excel.Visible =
False
08.
Dim
i, j
As
Integer
09.
10.
11.
i = 0
12.
Do
While
IsNumeric(wsheet.Cells(i + 3, 2).value) =
True
13.
i += 1
14.
RowE = i
15.
Loop
16.
17.
18.
j = 0
19.
Do
While
IsNumeric(wsheet.Cells(3, j + 2).value) =
True
20.
j += 1
21.
ColumnE = j
22.
Loop
23.
24.
25.
ReDim
Dta(RowE, ColumnE)
26.
ReDim
Dta2(RowE, ColumnE)
27.
28.
For
x = 1
To
RowE
29.
For
y = 1
To
ColumnE
30.
31.
Dta(x, y) = wsheet.Cells(x + 2, y + 1).value
32.
Dta2(x, y) = wsheet.Cells(x + 2, y + 1).value
33.
34.
35.
Next
36.
Next