Disable "File Not Found" dialog box

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

Hello!

I am working on code that opens a workbook, does stuff
with it, and then closes it. It is linked to two other
workbooks that cannot be in the same folder, therefore, I
keep getting the "File Not Found" dialog box which I have
to click close on each time I run the code. How can I get
rid of this annoying thing? I looked through Help and
couldn't find the designation fot this particular dialog
box (even more annoying!).

Any help will be greatly appreciated!

Sandy
 
Sandy,

Before the offending line of code....

On Error Resume Next

After the offending line of code...
On Error GoTo 0

This turns off error and turn on error handling.

Best regards,
Kevin H. Stecyk
 
Hi Kevin!

Thanks for your response.

What does "On Error GoTo 0" do? Where is the "0" that is
referred to?

Also, my code is in Access. Should I put this language in
Access, along with my other code?

Sandy
 
Hi Sandy,

On Error GoTo 0 merely returns the error handling. To be honest, I never
really understood the "0" either, other than it works and is what is stated
in the on-line help. Have a look there.

With regard should you enter the code in Access, I don't know. Have a look
at your Access help and check for error handling. I suspect that it is the
same, but if not, it should be similar.

All you want to do is cancel and reinitiate the error handling.

Hope that helps!

Best regards,
Kevin H. Stecyk
 
In this context, it's just a convention used to turn off error trapping. In effect, it means
"don't go anywhere". The roots are in early DOS BASIC where lines were always numbered, and you
were advised NOT to use the number 0, because of its special significance in cases like this.
 
Back
Top