View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default Drive Access Error

I have an application that tests for the existence of a text file in a
network server that has been mapped to drive Z: Depending on whether the
file exists determines the mode of the workbook. I use the following to
check.

If Len(Dir("Z:\myPath\myFile\myFile.txt")) 0 Then
'set mode 1
Else
'set mode 2
Endif

The above works well even if the user has not got a Z: drive mapped. If the
user has a drive Z: but does not have access rights to read the folder I get
a run-time error.

How can I change the test to prevent this?

--

Regards,
Nigel