Check the InternetGetConnectedState API function. It returns a non-zero value when online, and zero when offline.
___
[tt]
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (lpdwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Form_Load()
If InternetGetConnectedState(ByVal 0, 0) Then
MsgBox "connected"
Else
MsgBox "not connected"
End If
End Sub[/tt]