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