TransferSpreadsheet Error Checking

ListO

Señor Member
Local time
Today, 20:09
Joined
Feb 2, 2000
Messages
167
Hi, all...

I've got a little DB which needs to export and import a couple of tables from Excell97 spreadsheets. I've gotten all that to work just fine using TransferSpreadsheet, except that I can't figure out how to catch errors is someone tries to import a spreadsheet that doesn't exist in the given pathname.

Given a pathname/spreadsheet file name, how would I check to see that it really exists there before I purge my table to make way for the import?

Many thanks to all.

-Curt
 
this will check if a file is in a specified location.

If Len(Dir("PathToFile")) > 0 Then
MsgBox "File Exists"
Else
MsgBox "DOES NOT EXIST"
End If

Note: This will only tell you if the file is at the path location, not whether it is populated with info etc...

Ian
 
Thank you very much. The Len(Dir(filename)) test is just what I needed to make sure that the name of the path had been typed in correctly.

-curt
 

Users who are viewing this thread

Back
Top Bottom