Hi All - I've got a weird problem here that I couldn't find in another thread. I'm importing and Excel file into an existing Access table using a command button on a form. My code (as follows), delete all records from the table then imports the excel records.
cmdCommand.CommandText = "delete * from Opportunities"
cmdCommand.Execute
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Opportunities", sFileLocation, True, "A2:X5000"
PROBLEM: the Excel file is created from a download from PSFT CRM system. If I upload the file immediately using the above code, it is only importing a portion of the records. However, if I open the Excel File and then Save (not Save As) and them run the code, everything imports ok.
Everything looks ok with the Excel file (i.e. it's being saves as an Excel Worksheet when exported from our CRM), so don't know what's happening to the file when I open and save.
My thought on fixing/automating: in the code, open and save the Excel file and then import. I'm a fairly novice user and not sure exactly how to call the Excel file and Save it. Any help would be appreciated as to this solution or any other solution.
thanks,
-Ed
cmdCommand.CommandText = "delete * from Opportunities"
cmdCommand.Execute
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Opportunities", sFileLocation, True, "A2:X5000"
PROBLEM: the Excel file is created from a download from PSFT CRM system. If I upload the file immediately using the above code, it is only importing a portion of the records. However, if I open the Excel File and then Save (not Save As) and them run the code, everything imports ok.
Everything looks ok with the Excel file (i.e. it's being saves as an Excel Worksheet when exported from our CRM), so don't know what's happening to the file when I open and save.
My thought on fixing/automating: in the code, open and save the Excel file and then import. I'm a fairly novice user and not sure exactly how to call the Excel file and Save it. Any help would be appreciated as to this solution or any other solution.
thanks,
-Ed