ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting a network connection (https://www.excelbanter.com/excel-programming/289918-detecting-network-connection.html)

eric

Detecting a network connection
 
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?


Dick Kusleika[_3_]

Detecting a network connection
 
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

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

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





All times are GMT +1. The time now is 05:23 PM.

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