View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 39
Default Handling Errors with Workbooks.OpenText

I've got this line of code:

Workbooks.OpenText FileName:=sFilePath & ".xls", _
DataType:=xlDelimited, Tab:=True

The file is opened using the path and filename entered by the user
into a form.

How can I handle errors so that if the file/path is invalid or the
file doesn't exist, it gives an error message rather than falling
over?

Thanks.