Function GetSheetName(filepath As String, n As Integer) As String
'功能:返回标签名称
'引用:Mocrosoft ADO Ext 2.8 for DDL and Securty
'参数:filepath--Excel文件名,n--标签序号(从1开始)
Dim conn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim sheetname As String
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filepath & ";Extended Properties=Excel 8.0;"
conn.Open
Set cat.ActiveConnection = conn
sheetname = cat.Tables(n - 1).Name
conn.Close
Set cat = Nothing
Set cnn = Nothing
GetSheetName = sheetname
End Function