I used a converted Macro and made an adjustment to the code so the Access Table would go to an Existing Worksheet. It runs and works fine once or twice and then I receive an error stating: The Microsoft Jet Database Engine could not find the database ''. Make sure the object exists and you spell the name correctly.
I need the table to automatically transfer over when the button on the form is clicked.
Option Compare Database
'------------------------------------------------------------
' TransferMasterTabletoExcel
'
'------------------------------------------------------------
Function TransferMasterTabletoExcel()
On Error GoTo TransferMV22TabletoExcel_Err
' Transfer Master Table to Excel
DoCmd.TransferSpreadsheet acExport, 8, "Master Table", "J:\MyDocs\Inventory\REPORT\TableReportDistribution.xls", True, "MasterInventoryTable!A:AZ"
TransferMasterTabletoExcel_Exit:
Exit Function
TransferMasterTabletoExcel_Err:
MsgBox Error$
Resume TransferMasterTabletoExcel_Exit
End Function
I need the table to automatically transfer over when the button on the form is clicked.
Option Compare Database
'------------------------------------------------------------
' TransferMasterTabletoExcel
'
'------------------------------------------------------------
Function TransferMasterTabletoExcel()
On Error GoTo TransferMV22TabletoExcel_Err
' Transfer Master Table to Excel
DoCmd.TransferSpreadsheet acExport, 8, "Master Table", "J:\MyDocs\Inventory\REPORT\TableReportDistribution.xls", True, "MasterInventoryTable!A:AZ"
TransferMasterTabletoExcel_Exit:
Exit Function
TransferMasterTabletoExcel_Err:
MsgBox Error$
Resume TransferMasterTabletoExcel_Exit
End Function