PDA

View Full Version : Detect Internet Connection



Kicker
02-14-2019, 08:01 PM
Looking for a simple method to test if the computer is connected to the internet. True or false.

I have a program that is used across several remote locations and it needs to determine if there is an internet connection.

I'm using dropbox as a repository for the files.

Any ideas?

OBP
02-15-2019, 12:33 PM
You could try this one.
https://docs.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-check-connection-status

Kicker
02-15-2019, 04:27 PM
You could try this one.
https://docs.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-check-connection-status

Darn that seems simple....

If My.Computer.Network.IsAvailable Then MsgBox("Computer is connected.")Else MsgBox("Computer is not connected.")End If

I tried this but it is asking me to define "My." Is that the name of the application or possibly a control or form? I really appreciate your replies.

OBP
02-16-2019, 02:39 AM
OK, that code is only available for VB and not VBA.
I have found other code that are little more complicated, this guy has listed a few.
https://www.mrexcel.com/forum/excel-questions/236542-vba-determine-if-computer-has-web-connection.html