Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Internetconnection

Hi,

I wonder if it is possible to see if someone has connection to the internet
on startup of the application.

Now I download a small file and if it succeeds, I know the user has
connection, but it seems to be a little slow. Is there a command like:

if (InternetConnection) then
msgbox "The user is connected to the internet", vbOKOnly
else
msgbox "The user is not connected to the internet", vbOKOnly
end if

Thanks
Jos Vens


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Internetconnection

Jos,
Try Karl's excellent site:
http://vb.mvps.org/articles/ap199812.pdf

NickHK

"Jos Vens" wrote in message
...
Hi,

I wonder if it is possible to see if someone has connection to the

internet
on startup of the application.

Now I download a small file and if it succeeds, I know the user has
connection, but it seems to be a little slow. Is there a command like:

if (InternetConnection) then
msgbox "The user is connected to the internet", vbOKOnly
else
msgbox "The user is not connected to the internet", vbOKOnly
end if

Thanks
Jos Vens




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Internetconnection

Hi Leith,

it works flashing fast! Thanks!!!!

Jos

"Leith Ross"
schreef in bericht
...

Hello Jos,

Here is a macro that tests if you are connected to the internet or not.
This will work with dialup, DSL, and most LANs. If you have a LAN with
auto dial it may not work. This works with Windows 95, 98, ME, 2000. I
haven't used it on 2003. So if you are running 2003 you should test it
and see if it works correctly. Add a VBA module to your project and
copy this code into it. The function returms true if you are connected
to the internet and false uf you are not.

EXAMPLE:
Answer = IsInternetConnected


Code:
--------------------
Public Declare Function GetInternetState _
Lib "Wininet.dll" _
Alias "InternetGetConnectedState" _
(ByVal lpdwFlags As Long, _
ByVal Reserved As Long) As Long

Public Function IsInternetConnected() As Boolean

Dim Flags As Long
Dim Ret

Ret = GetInternetState(Flags, 0&)
IsInternetConnected = Ret

End Function

--------------------

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=484772



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



All times are GMT +1. The time now is 05:40 PM.

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

About Us

"It's about Microsoft Excel"