View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 121
Default Newbie Q: Error handling procedures in a loop

Excellent, this is a much preferable solution (and bonus- easy enough for me
to understand :)

"Jim Thomlinson" wrote in message
...
Error handling should realy only be used to handle unaticipated events,

such
as the lack of a network connection, or something that will only happen

once
ina blue moon. If you can reasonaly expect something to happen then you

shoud
write your code to anticipate that event. (Error handling actually has a

lot
of overhead that will slow down your code). My recomendation for your
procedure would be to use the Dir function just ahead of the open.

if Dir(FileName & Path) = Filename then
'open the file and read from it... with your code
end if

HTH