...or if you dont want to change drive:
Declare Function WNetGetConnection Lib "mpr.dll" Alias "WNetGetConnectionA" _
(ByVal lpszLocalName As String, _
ByVal lpszRemoteName As String, _
cbRemoteName As Long) As Long
Function NetworkDriveExists(i_strDriveLetter As String, ByRef o_strUNCPath As String) As Boolean
Dim lngReturn As Long
Dim strLocalName As String
Dim strRemoteName As String
Dim lngRemoteName As Long
If Right(i_strDriveLetter, 1) <> ":" Then
i_strDriveLetter = i_strDriveLetter & ":"
End If
strRemoteName = String$(255, Chr$(32))
lngRemoteName = Len(strRemoteName)
If WNetGetConnection(i_strDriveLetter, strRemoteName, lngRemoteName) = 0 Then
NetworkDriveExists = True
o_strUNCPath = Left(strRemoteName, InStr(strRemoteName, Chr(0)) - 1)
Else
NetworkDriveExists = False
o_strUNCPath = vbNullString
End If
End Function
This will also return the UNC for the drive letter specified (if you fancy that sort of thing)
M
