Tom’s Tutorials For Excel: Verifying Your Internet Connection

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
Share Button
Posted in Tom's Tutorials for Excel
Tags: , , , , , , , , , , , ,
2 comments on “Tom’s Tutorials For Excel: Verifying Your Internet Connection
  1. sandeep says:

    Great!

Leave a Reply

Your email address will not be published. Required fields are marked *

*