Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

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
Avatar of Nico Bontenbal
Nico Bontenbal
Flag of Netherlands image

Adding text in a numerical or date column will give you an error.
ASKER CERTIFIED SOLUTION
Avatar of Nick67
Nick67
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial