How to export a table from another access database to excel -


I have a front end access database, which now has form and code and a back end access database that has all the data tables. . I am creating a temporary access database to make all necessary calculations. I have a button within a form on the front-end database, when the table should be output to the table in the database so that it is excel. When I try to use docmd.outputto or docmd.transferspreadsheet, I get a single error # 3011 - Microsoft Access database engine could not find an object. Do I need to try exporting tables using a different command or do I?

<> sub expottbl () error goto Err_handle dim rstable as DAO.Recordset is trying to do something that is not even possible DAO.Recordset slow ppath form rsplan dim String tmpdb dim as DAO.Database bedb as dim as DAO.Database set DAO.Workspace wrkacc = DBEngine (0) set tmpdb = wrkacc.OpenDatabase (tmppath) ppath = "c wrkacc dim: / my document "Check for an open file if IsXLBookOpen (ppath) = true then MSBBC" Excel workbook used by another user C is set rstable = nothing rsplan.Close: set rsplan = nothing tmpdb.Close wrkacc.Close set tmpdb = nothing set wrkacc = nothing sub-end then rstable.Close: file "Rstable.Close can not be exported set rstable = nothing rsplan.Close: set rsplan = nothing 'export table DoCmd.SetWarnings incorrect' outputto option DoCmd.OutputTo acOutputTable," calc_tbl ", acFormatXLSX, ppath, False, "", 0 'transferspreadsheet option DoCmd.TransferSpreadsheet acExport, AC spreadsheetXcel 12, "calc_tbl", ppath, false MsgBox strloc & amp; "File exported:" & amp; VbCrLf & amp; Ppath, vbInformation, "DoCmd.SetWarnings" true set tmpdb = nothing set wrkacc = nothing exit exit exit_handle: 'exit sub Err_handle for exit error:' error information MsgBox & MS Access The following error has occurred ", vbCrLf & amp; VbCrLf & amp; "Error number:" & amp; _ Err.Number & amp; VbCrLf & amp; "Error Description:" & amp; _ Err.Description, vbCritical, "An error has occurred!" Exit_handle ending sub restart


Comments