Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Internet connection?

Tom, Robin, Thank you very much for your assistance.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet connection stuenov Excel Discussion (Misc queries) 0 February 22nd 09 07:25 PM
Internet connection stuenov Excel Discussion (Misc queries) 0 February 18th 09 03:52 PM
internet connection process at exel start tim Biedermann Setting up and Configuration of Excel 1 October 14th 06 03:53 PM
msn stock updates quit working & no internet connection in excel K9CE Excel Discussion (Misc queries) 0 July 13th 06 04:36 PM
dialog box displayed when internet connection unavailable nil Excel Programming 2 January 28th 04 10:04 PM


All times are GMT +1. The time now is 03:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"