Sub AdoTs()
Dim cat
Dim cnn
Dim c
Set cnn = CreateObject("ADODB.Connection")
Set cat = CreateObject("ADOX.Catalog")
cnn.Open "provider=microsoft.jet.oledb.4.0;extended properties='Excel 8.0';Data Source = " _
& ThisWorkbook.Path & "\abc.xls"
Set cat.ActiveConnection = cnn
For Each c In cat.Tables
Debug.Print c.Name
Next c
Set c = Nothing
Set cat.ActiveConnection = Nothing
Set cat = Nothing
Set cnn = Nothing
End Sub
用这个代码试下
追问你这个是不是在access下的,我要excel下的,最好在单元格中输出