Read Excel file sheet names

后端 未结 2 1555
天命终不由人
天命终不由人 2021-01-25 08:02

I have an export process that transfers data from my Access tables to an Excel File. A couple times I have had issues where the process didn\'t generate one or more of the sheet

2条回答
  •  悲&欢浪女
    2021-01-25 08:30

    In Access 2007, You can use OpenDatabase method to do this:

    Private Sub Command1_Click()
    Set db = OpenDatabase("c:/123.xls", True, False, "Excel 5.0")
        For Each tbl In db.TableDefs
            MsgBox tbl.Name
        Next
    End Sub
    

提交回复
热议问题