Search

VBA to check if User has access to Network/Directory

VBA to check if User has access to Network/Directory.

Option Explicit

'-----------------------------
'Thanks for downloading the code. 
'Please visit our channel for a quick explainer on how to use this code.
'Feel free to update the code as per your need and also share with your friends.
'Download free codes from http://vbaa2z.blogspot.com
'Support our channel: youtube.com/vbaa2z
'Author: L Pamai (vbaa2z.team@gmail.com)
'-----------------------------

Debug.Print FolderIsWriteable("D:\")

Function FolderIsWriteable(sFolder As String) As Boolean
    On Error Resume Next
    FolderIsWriteable = (GetAttr(sFolder) And vbReadOnly) <> 1
    Exit Function
End Function


No comments:

Post a Comment

Note: only a member of this blog may post a comment.