Tom’s Tutorials For Excel: Verifying Your Internet Connection
With the help of an API declaration, here’s a method for verifying if the active workbook’s system is connected to the internet.
Thanks to MS Excel MVP Mike Alexander at Datapig Technologies for his help with this to include wireless connections in the verification process.
Private Declare Function IsNetworkAlive Lib "Sensapi" _ (lpdwFlags As Long) As Long Sub TestConnect() If IsNetworkAlive(lngAlive) = 1 Then MsgBox "You are connected to the internet." Else MsgBox "Connection to the internet not found." End If End Sub
Great!
See my reply to your third comment.