ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable "File Not Found" dialog box (https://www.excelbanter.com/excel-programming/276026-disable-file-not-found-dialog-box.html)

Sandy[_3_]

Disable "File Not Found" dialog box
 
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



Kevin Stecyk

Disable "File Not Found" dialog box
 
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

"Sandy" wrote in message
...
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[_3_]

Disable "File Not Found" dialog box
 
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


-----Original Message-----
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

"Sandy" wrote in message
...
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




.


Kevin Stecyk

Disable "File Not Found" dialog box
 
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


"Sandy" wrote in message
...
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


-----Original Message-----
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

"Sandy" wrote in message
...
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




.




Myrna Larson[_2_]

Disable "File Not Found" dialog box
 
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.


On Wed, 3 Sep 2003 19:59:55 -0600, "Kevin Stecyk" wrote:

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


"Sandy" wrote in message
...
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


-----Original Message-----
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

"Sandy" wrote in message
...
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




.





All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com