Vikram, try following:
Note: The API function gives a bit more information, but I've only used
the essenstial "Offline/online flag INTERNET_CONNECTION_OFFLINE = &H20&
Option Explicit
Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll"
Alias _
"InternetGetConnectedStateExA" (ByRef lpdwFlags As Long, ByVal _
lpszConnectionName As String, ByVal dwNameLen As Long, ByVal
dwReserved As _
Long) As Long
Function IsOnLine() As Boolean
Dim lFlag As Long
Dim sName As String
sName = Space(1)
If InternetGetConnectedStateEx(lFlag, sName, 0&, 0&) Then
IsOnLine = Not (lFlag And &H20)
End If
End Function
--
keepITcool
|
www.XLsupport.com | keepITcool chello nl | amsterdam
Vikram wrote in
<news:<(E-Mail Removed)>
> I am developing an add-in which uses web query to update script prices
> from the website.
> As an error handling routine, I want to make sure that no error is
> flashed by excel if someone tries to update price when there is no
> internet connection available.
>
> So can anyone suggest me how I can do this?