Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 groups.com 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot. It worked!!!!
keepITcool wrote: 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 groups.com 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? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot. It worked!!!!
keepITcool wrote: 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 groups.com 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Internet connection | Excel Discussion (Misc queries) | |||
Internet connection | Excel Discussion (Misc queries) | |||
Close Internet connection | Excel Programming | |||
Internet Connection | Excel Programming | |||
Internet connection? | Excel Programming |