Import from Excel Using TransferSpreadsheet
I figured out the syntax to export the data to excel, I just need to be able to import the same file into a updated version of the database
Thank you for taking the time to report an issue.
What's wrong... Please write below.
Manual delete tables Table1, Table2, Table3, Table4.
Open the macro to TransferSpreadsheet exel TableA
Open the macro to TransferSpreadsheet exel TableB
Open the macro to TransferSpreadsheet exel TableC
Open the macro to TransferSpreadsheet exel TableD
All these tables have the same type of data, and field names
Run append query to Master_Append_qty for all 4 Tables.
Then clicking ok would import the selected excel sheet into the appropriate columns in the access table.
My thought would be to import the excel sheet using transferspreadsheet and use the tabledef to get the field names from the excel sheet and the destination table (destination fields indrop down) then run insert statement using the mapping.
My thought would be to import the excel sheet using transferspreadsheet and use the tabledef to get all the field names from the excel sheet and the destination table (destination fields in drop down) then run insert statement using the mapping.
Using the import wizard or the TransferSpreadsheet command, I keep getting the following error: Method 'Execute TempImexSpec' of object '_Wizhook' failed. Despite this, the Excel worksheet imports, but with some cells dropped.
Nothing in the cells I could find seems to be causing the problem. I also tried CSV and tab delimited files, but I had the same issues (with even more dropped cells).
I Googled the error and found very few pages on it, MSDN came up with nothing at all.
I chalked this up to general Vista/Access 2007 issues and began looking for a VBA workaround, but am having trouble finding one that works.
As of now, I've decided to loop through the contents of the Excel file and read them into a two-dimensional array, figuring that this might be a way to avoid the TransferSpreadsheet errors I was encountering.
but I'm getting a 'subscript out of range error' while looping through the sheet.
The code needs to be set up so the user can select the Excel file then the 8 imports will run. The amount of data on each sheet will vary every time so I don't think named ranges would be a practical way of handling it.
Just for a bit more background, this process sets up a new backend database, then the spreadsheet import will bring in user developedstartup data (ie user table, labor codes table,.)
Am I just missing something in the TransferSpreadsheet method?
In Summary: I need to provide the Excel file (path and name) then run an import for each of the 8 sheets into 8 different tables.
Macro Name: Import
Action Name: TransferSpreadsheet
Arguments: Import, 10,Offline, O:\Access\ImportOff,Yes,
Error Number: 2950
Im not exactly sure why this error is appearing, the MS documentation I read stated that this error occurs when the database is not in a trusted location but I have checked and confirmed that it is, does anybody know anyway to resolve this
external table is not in the expected format.
heres my code:
oCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"tbl_SP_SHIPMENT_temp", "C:\InvoiceReports\UPSExcelImport.xlsx", True, "UPSINVOICEREPORTS" DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _ "tbl_SP_SHIPMENT_TEMP", "C:\InvoiceReports\FEDEXExcelImport", True, "FEDEXINVOICEREPORTS"
can anyone tell me what I am doing wrong. Ive not used this in a while
I figured out the syntax to export the data to excel, I just need to be able to import the same file into a updated version of the database.