View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Check online network availability

Very Cool. Thanks. I have no need for it right now, but it should come in
handy at some point in my life...

"AA2e72E" wrote:

Try:

Private Declare Function IsNetworkAlive Lib "SENSAPI.DLL" (ByRef lpdwFlags
As Long) As Long

Sub xx()
Select Case IsNetworkAlive(0)
Case 0
MsgBox "not connected"
Case 1
MsgBox "connected to LAN"
Case 2
MsgBox "connected to WAN"
Case Else
MsgBox "connected to ?other network?"
endselect
End Sub

You probably want to verify whether IsNetWorkAlive returns 0 or nonzero only.

" wrote:

Hi Friends

I want to establish, if the user is on-line with the network
fileserver. Scroll drives or using FileExist method (File Scripting
object) wont do the trick, because the path will often, but not always,
be available offline. I've got to know if they are connected - any
idea's?
Thanks/Mike