Sub AdoCnnFile()
Dim cnn As New ADODB.Connection
cnn.Open "provider=Microsoft ACE OLEDB.12.0;data source=F:\ExcelVBA练习\PDR文件夹\pdr-6月.xlsx"
ThisWorkbook.Sheets(1).[a1].CopyFromRecordset cnn.Execute("select * from [sheet1$a:j]")
Set cnn = Nothing
End Sub
''你怎么能写那么长?连接字符串多了xml,select语句错误
''有效请采纳