zimmer9
asked on
How could you create a formatting error in the attached Excel file so that the DoCmd.TransferSpreadsheet command does not work properly?
I am developing an Access application using Access 2003 with an MDB type file.
My Access application imports an Excel file into an Access table via the DoCmd.TransferSpreadsheet command.
A sample Excel file for my application follows in the File attachment section.
Do you know how I could modify the attached Excel file to cause a format error to occur when the DoCmd.TransferSpreadsheet command executes?
I want to test my application to ensure that it can handle an error in the format of the Excel file to be imported.
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Bank Credits (A)", filenm, False, "Bank Credits (A)!A:N"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Bank Debits (B)", filenm, False, "Bank Debits (B)!A:N"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Book Debits (C)", filenm, False, "Book Debits (C)!A:N"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Book Credits (D)", filenm, False, "Book Credits (D)!A:N"
555--02-15-2011.xls
My Access application imports an Excel file into an Access table via the DoCmd.TransferSpreadsheet command.
A sample Excel file for my application follows in the File attachment section.
Do you know how I could modify the attached Excel file to cause a format error to occur when the DoCmd.TransferSpreadsheet command executes?
I want to test my application to ensure that it can handle an error in the format of the Excel file to be imported.
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Bank Credits (A)", filenm, False, "Bank Credits (A)!A:N"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Bank Debits (B)", filenm, False, "Bank Debits (B)!A:N"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Book Debits (C)", filenm, False, "Book Debits (C)!A:N"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Book Credits (D)", filenm, False, "Book Credits (D)!A:N"
555--02-15-2011.xls
Adding text in a numerical or date column will give you an error.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.