Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Trapping With DoCmd.TransferSpreadsheet

Status
Not open for further replies.

BTilson

Programmer
Jul 14, 2004
139
US
Hello all,

Is there any way to programatically verify that a docmd.transferspreadsheet call completes succesfully? I am working on a utility that imports several different spreadsheets from several different customers, and then runs some basic analysis on the data. However, when the end user clicks the "Import Spreadsheet" button I have put on the form, I would like to have some way to check and make sure the transferspreadsheet call completes succesfully. My main concern is whether or not the user has put the correct spreadsheet in the correct directory. I would much rather have a custom coded alert tell them what is wrong, than to have access just throw it's own error and take them to the debug screen. I've had experience with that before and it usually doesn't seem to go so well :)

Any help or ideas are greatly appreciated!

Thanks!

Brooks Tilson
Database Development
Tilson Machine, Inc.
 
well, you can test for the existence of the excel file before transfer, and also verify there's something in the file. Also, after transfer, you can check if new records were entered.

however, short of wrapping your entire function with an error handler, you'll never completely manage to get rid of jumping to debug. In fact, I'm not sure why you don't wrap all functions with error handlers...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top