Are there any VBA code to look for a present internet connection?
I have a code that will run on a timer. This code will open a file on a local network share drive. I am looking for some type of On Error Goto ErrorMessage code if it tries to open the file when the network isn't connected.
You can check the
Len
ofDir
on the shared drive you're trying to get to:This function works on both Mac and PC, with 32 as well as 64 bit Excel versions.
Declaration:
Function:
Using the function in a Sub:
I usually use the code below to determine if a network connection exits. The function returns true or false.
Declaration:
Function:
Using the function in a Sub: