Sub new_load()
Dim dbConnection As New ADODB.Connection
Dim rsADO As New ADODB.Recordset
Dim cat As Object
Dim tbl As Object
Dim lRow As Long
Dim szBookName, mycCMD As String
Dim szConnect As String
Dim szTableName As String
szBookName = ThisWorkbook.Path & "\data.xls"
szConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & szBookName & ";" & _
"Extended Properties=Excel 8.0;"
Set dbConnection = New ADODB.Connection
dbConnection.Open szConnect
myCmd = "SELECT master,sub,sales FROM [Sheet1$] "
rsADO.Open myCmd, dbConnection, adOpenStatic
Dim i As Integer
' i = rsADO.recordcount
rsADO.MoveFirst
For i = 1 To rsADO.recordcount
If Not rsADO.EOF Then
Cells(i, 1) = rsADO.Fields(0)
Cells(i, 2) = rsADO.Fields(1)
Cells(i, 3) = rsADO.Fields(2)
rsADO.MoveNext
End If
Next
dbConnection.Close
Set cat = Nothing
Set dbConnection = Nothing
End Sub