Error Handling for not finding network address? ...ignore without popup.

chuggins143

Board Regular
Joined
Nov 10, 2009
Messages
100
Hello all,

I have a macro that will go out to a text file on our server and retrieve some data... obviously, it works fine when I'm connected, but if I lose connection with the server then I get a window that says... "Sorry, we couldn't find 'file address'. Is it possible it was moved, renamed, or deleted?" I'd like to automate the sheet so that it'll run the macro every few min, but ignore the error if it loses connection. Anyone have a suggestion on how to have my code ignore this error?

TIA,

Chad
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
VBA Code:
On error resume next
----open the file --
if err.number <> 0 then
   exit sub
else
    -- process your task  --
end if
 
Upvote 0
Solution
JSB, Thank you for the response!

I did have to add the following at the top of my sub to get the popup to stop too...

Application.DisplayAlerts = False

The combination of these seems to have stopped the annoying popup I was getting... the first time it goes and tries to find it takes a few seconds, but once the computer realizes that it can't get to the server then it's virtually instantaneous.

Thanks!

Chad
 
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top