Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Internet connection?
Using VBA codes I can now determine whether Microsoft Outlook or Outlook Express is installed on a PC with the help from Michel Pierron. Can using VBA codes determine whether a PC is connected to the internet or intranet? Any help is very much appreciated.
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Internet connection?
You can start at Randy Birch's site:
http://vbnet.mvps.org/code/network/i...ectedstate.htm -- Regards, Tom Ogilvy Francis Ang" wrote in message ... Using VBA codes I can now determine whether Microsoft Outlook or Outlook Express is installed on a PC with the help from Michel Pierron. Can using VBA codes determine whether a PC is connected to the internet or intranet? Any help is very much appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Internet connection?
Francis,
try these API calls. I played with this for a while myself until I found this combination that seems to give a reliable result. Option Explicit Option Private Module Private Declare Function InternetGetConnectedState Lib "wininet" _ (ByRef dwFlags As Long, _ ByVal dwReserved As Long) As Long Private Declare Function InternetCheckConnection Lib "wininet.dll" _ Alias "InternetCheckConnectionA" (ByVal sUrl As String, _ ByVal lFlags As Long, ByVal lReserved As Long) As Long Sub Test If IsNetConnected = FALSE then Exit Sub 'do something internet related End Sub Public Function IsNetConnected() As Boolean Dim lReturn As Long IsNetConnected = InternetGetConnectedState(lReturn, 0) 'pick an IP or net address to go in the function call If IsNetConnected = False Then _ IsNetConnected = InternetCheckConnection("http://www.yahoo.com", 1, 0) If IsNetConnected = False Then _ Call MsgBox("You do not appear to have an active internet connection at this time" _ & vbcrlf & vbcrlf & "Please connect to the internet then retry this command", _ vbOKOnly + vbInformation, msgTitle) End Function HTH, Robin Hammond www.enhanceddatasystems.com "Francis Ang" wrote in message ... Using VBA codes I can now determine whether Microsoft Outlook or Outlook Express is installed on a PC with the help from Michel Pierron. Can using VBA codes determine whether a PC is connected to the internet or intranet? Any help is very much appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Internet connection?
Tom, Robin, Thank you very much for your assistance.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Internet connection | Excel Discussion (Misc queries) | |||
Internet connection | Excel Discussion (Misc queries) | |||
internet connection process at exel start tim | Setting up and Configuration of Excel | |||
msn stock updates quit working & no internet connection in excel | Excel Discussion (Misc queries) | |||
dialog box displayed when internet connection unavailable | Excel Programming |