dhancy
Board Regular
- Joined
- Jul 10, 2013
- Messages
- 123
- Office Version
- 365
- Platform
- Windows
I have a VBA script that cycles through subfolders looking for a specified file.
Often, there are subfolders to which I do not have access. My script ends with a "permission denied" error.
Is there something I can add to my code that will check permissions on a folder before attempt to access it? In the code snippet below. the script errors out on the "For" line.
Thanks!
Often, there are subfolders to which I do not have access. My script ends with a "permission denied" error.
Is there something I can add to my code that will check permissions on a folder before attempt to access it? In the code snippet below. the script errors out on the "For" line.
Code:
Dim objFolder as Object
Dim objFile as Object
Set objFolder = objFSO.GetFolder(targetFolder)
For Each objFile In objFolder.Files
...
Next
Thanks!