Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Easy Way to Check File Privileges?
I am recursively looping through a folder hierarchy, and then through all the
files in each folder. As part of my process, I need to check my ability to open each of the files (i.e. do I have the correct permission) for read or read/write. Is there a quick way to do this in VBA without actually trying to open each file? Here is some fragmentary code to illustrate my use of variables (from the NG, of course): Dim fso As Scripting.FileSystemObject Dim oDir As Folder Dim fSubDir As Folder ' Used for recursion... Dim oFile As File .... Set fso = CreateObject("Scripting.FileSystemObject") Set oDir = fso.getfolder(strPath) .... For Each oFile In fSubDir.Files ' check to see if I have "Read" or "Read/Write" permission for each file ' and report those for which I don't Next oFile Thanks in advance, Eric |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
is there an easy way to convert an word xp file to excel xp? | Excel Discussion (Misc queries) | |||
Is there an easy way to open a text file and modify only a part of it? | Excel Programming | |||
code to check file size everytime an Excel file is opened | Excel Programming | |||
easy way to check for forbidden characters? | Excel Programming | |||
Auto Run and Installation privileges | Excel Programming |