hellfire45
Active Member
- Joined
- Jun 7, 2014
- Messages
- 464
In the below code, I am trying to append the data in the file destinationpath & CRT_File_Backlog to the bottom of the access database table, strAccPath & tbl_backlog
destinationpath & CRT_File_Backlog(excel 2013 .xlsx) >>>>>>>> strAccPath & tbl_backlog(Access 2003 dbo)
The VBA editor is giving me the error Run-Time Error 3274 "External Table is not in the expected format."
And honestly, I'm not sure I've written this up correctly. Can anybody help me correct the error of my way?
Thanks so much!
destinationpath & CRT_File_Backlog(excel 2013 .xlsx) >>>>>>>> strAccPath & tbl_backlog(Access 2003 dbo)
The VBA editor is giving me the error Run-Time Error 3274 "External Table is not in the expected format."
And honestly, I'm not sure I've written this up correctly. Can anybody help me correct the error of my way?
Thanks so much!
Code:
Option Explicit
Sub File_Uploads_1()
Dim CRT_File_Backlog, CRT_File_Shipments, CRT_File_Serials, CRT_File_Tracking, destinationpath As String
Dim strAccPath, tbl_backlog, tbl_serials, tbl_shipments, tbl_tracking As String
Application.DisplayAlerts = False
Application.CalculateBeforeSave = False
Application.Calculation = xlManual
Application.ScreenUpdating = False
Application.EnableEvents = False
'location and name of files to the appended to the bottom of a subsequent access database tables
If Dir("I:\ASM\All\CRT\Reporting\In Consolidation Process\Master Automation\Saved CRT Uploads\" & Format(Date, "yyyy-mm-dd"), vbDirectory) = "" Then
MsgBox "No Files Found. Please run Batches and then try again."
End
Else
destinationpath = "I:\ASM\All\CRT\Reporting\In Consolidation Process\Master Automation\Saved CRT Uploads\" & Format(Date, "yyyy-mm-dd") & "\"
CRT_File_Backlog = "CRT UPLOAD Backlog - " & Format(Date, "mm-dd-yyyy") & ".xlsx"
CRT_File_Shipments = "CRT UPLOAD ETAs from Shipments - " & Format(Date, "mm-dd-yyyy") & ".xlsx"
CRT_File_Serials = "CRT UPLOAD Serials - " & Format(Date, "mm-dd-yyyy") & ".xlsx"
CRT_File_Tracking = "CRT UPLOAD Tracking- " & Format(Date, "mm-dd-yyyy") & ".xlsx"
End If
'Location of access database and name of tables
strAccPath = "I:\ASM\All\CRT\Reporting\In Consolidation Process\Master Automation\CRT Database.mdb"
tbl_backlog = "Backlog"
tbl_serials = "Serials"
tbl_shipments = "Shipments"
tbl_tracking = "Tracking"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, tbl_backlog, destinationpath & CRT_File_Backlog, -1