Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dialog box displayed when internet connection unavailable

24 views
Skip to first unread message

nil <>

unread,
Jan 28, 2004, 3:46:40 PM1/28/04
to
help! i am building a system which uses web queries to import data from
the internet. when i open the file, and there is no internet connection
(i am on dial up) i am bombarded with dialogs telling me the site was
unavailable, is there any code which i can input into my auto_open
which will disable these message boxes, i have already tried

application.displayalerts = false

and

application.autoresponse

but that is only available in excel 2000.

Has ANYONE got any suggestions out there???
thanks in advance

nilzz


---
Message posted from http://www.ExcelForum.com/

Ron de Bruin

unread,
Jan 28, 2004, 4:08:03 PM1/28/04
to
Hi Nilzz

You can use code like this in your subroutine to avoid errors
if you are not online (only with dial up connections)

For checking other connections check out this website
http://www.mvps.org/vbnet/

Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (lpdwFlags As Long, _
ByVal dwReserved As Long) As Boolean
Function IsConnected() As Boolean
Dim Stat As Long
IsConnected = (InternetGetConnectedState(Stat, 0&) <> 0)
End Function

Sub Test()
' Randy Birch
If IsConnected = True Then
MsgBox "Copy your code here"
Else
MsgBox "You can't use this subroutine because you are not online"
End If
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl

"nil >" <<nil.1...@excelforum-nospam.com> wrote in message news:nil.1...@excelforum-nospam.com...

nil <>

unread,
Jan 28, 2004, 5:04:16 PM1/28/04
to
hmmm... i understand what to do, but wat is that winking smily supposed
to be? is it a ;- )?
0 new messages