I can't test it because I don't have a network here, however the simple API
call listed here seems like it should do what you want...
http://vbnet.mvps.org/index.html?cod...fileexists.htm
--
Rick (MVP - Excel)
"BAC" <(E-Mail Removed)> wrote in message
news:9B8D2CE3-C321-477C-8A78-(E-Mail Removed)...
> Office 2007 SP1; XP Pro SP2
>
> I have the following code to determine if a given path has been mapped on
> a
> user's machine:
>
> Function fn_Test_4_Drive() As Integer
> fn_Test_4_Drive = 0 'Drive does not exist
> Dim fs, d, dc, n
> Set fs = CreateObject("Scripting.FileSystemObject")
>
> Set dc = fs.Drives
> For Each d In dc
> ' Debug.Print d.sharename
> If InStr(1, d.sharename, "\\crpatlfnp03\temp") > 0 Then
> fn_Test_4_Drive = 1
> Exit Function
> End If
> Next d
>
> ret = MsgBox("It appears you do not have a connection to the drive
> \\crpatlfnp03\temp." & Chr(13) & _
> "Please get this drive mapped for future wires.", vbOKOnly,
> "Missing
> drive!")
>
> End Function
>
> Several users have the test to fail, even if the drive is mapped.
>
> Initially I used an if fs.folderexists test, but it gave me the same
> erroneous results so I went to the above Function.
>
> Note the debug print that I used to confirm that the d.sharename being
> returned was indeed the value being tested for.
>
> Is there any reason these tests should function on some machines but not
> on
> others?
>
> All machines are running Office 2007 SP1; XP Pro SP2
>
>