View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SuperJas SuperJas is offline
external usenet poster
 
Posts: 66
Default Error Handling and For-Next Loops

Hi

I am in the (hopefully) last stage of finishing my File Scanner. However, I have run into some files where the Permission is denied (Err.Number=70). To get around this, I have set up an Error Handler. The main snippets of my program is shown below

-----------------------------
Sub StoreFiles(

On Error Goto ErrHandle

..

For Each File in File

..

SkipFile

Next Fil

..

Exit Su

ErrHandler

If Err.Number=70 The

Resume SkipFil

EndI

End Sub(
-----------------------------

However, doing this comes back with the error that the For Loop wasnt initialised (Error 92)€

How can I get around this

Many thanks for your help

SuperJas