如何将Access文件转换为Excel文件?

如何将Access文件转换为Excel文件?
2024-12-21 20:15:14
推荐回答(1个)
回答1:

Private Function AccessToExcel(strSourcePath As String, strReportPath As String, strObjectName As String) As Boolean
On Error GoTo E
Dim acApp As Access.Application
Set acApp = GetObject(strSourcePath, "Access.Application")
acApp.DoCmd.OutputTo acOutputTable, strObjectName, acFormatXLS, strReportPath
acApp.CloseCurrentDatabase
Set acApp = Nothing
AccessToExcel = True
Exit Function
E:
AccessToExcel = False
End Function