Public Sub ConnectToExcel()
Set Cnn = New ADODB.Connection
With Cnn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.ConnectionString = "Data Source=C:\temp\TEST\Test1.xlsx;" & _
"Extended Properties=""Excel 12.0; Xml; HDR=YES; IMEX=1"""
.Open
End With
strQuery = "SELECT * FROM [Лист1$]"
Set rst = Cnn.Execute(strQuery)
MsgBox rst.GetString
End Sub