Detecting a network connection

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I need to be able to detect whether or not a computer is
connected to a network when the excel application I am
working on is opened. The application is going to run on a
tablet PC that will not always be connected to a network.
I want to automatically refresh imported information when
the application opens but only if a network connection is
available. Has anyone ever done this?
 
Eric

Will you know the path to the network? If so, you can attempt to use the
ChDir command to change to that path and trap the error if the path doesn't
exist.

On Error Resume Next

ChDir "S:\"

If Err.Number = 76 Then
'Not connected
Else
'Connected
End If
 
Back
Top