LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Testing if Directory has read/write access

Try something like the following:

Dim Attr As Long
Attr = GetAttr("\\DellLapTop\MainDrive\Temp")
If Attr And vbReadOnly Then
Debug.Print "Folder is read-only"
Else
Debug.Print "Folder is read-write"
End If

You can also do it with the Scripting.FileSystemObject

Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.GetFolder("\\DellLapTop\MainDrive\Temp").Attri butes And 1 Then
Debug.Print "Folder is read only"
Else
Debug.Print "Folder is read-write"
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Nigel RS" wrote in message
...
What is the best method of testing if a directory has read and write
access?

I have an application that saves files to a network server, I want to test
that the user on opening the application (from a local drive) has read or
read/write access to the remote server directory.

Thanks



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get write access from read-onlly mode Maus Excel Discussion (Misc queries) 1 August 14th 09 05:04 PM
Testing of a workbook is in read only mode GLT Excel Programming 1 January 24th 06 04:39 PM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM
Testing for filke in directory Helen Excel Programming 5 January 10th 05 12:07 AM
Getting open file's directory, captureing user login ID, write access Claud Balls Excel Programming 2 December 23rd 04 11:47 PM


All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"