Can Excel VBA List Users with Restricted Access to an Excel File?
Question details
The user wants to know whether Excel VBA can list users with restricted access to an Excel file stored in SharePoint, OneDrive, or a network location, and what supported alternatives exist.

- Product
- Microsoft Excel VBA (SharePoint/OneDrive hosted files)
- Device & OS
- not provided
- Scenario
- The user has an Excel file hosted in SharePoint, OneDrive, or a network share and needs to audit restricted user permissions programmatically.
- Observed behavior
- The goal is to obtain an accurate restricted-user permission list from the file hosting service or network administrator because Excel VBA does not expose file-level permission data.
Before checking restricted access, confirm where the Excel file is stored (SharePoint, OneDrive, or a network share) and ensure you have or can contact an account with admin, site owner, or network administrator privileges.
Check Restricted Users in Microsoft 365 Admin Center or SharePoint Permissions
Best for SharePoint and OneDrive files when you have admin access and need a built-in permissions view without writing API code.
Excel VBA does not expose file-level permission data for SharePoint or OneDrive. Microsoft 365 and SharePoint admin tools are the supported way to view and audit restricted access.
Sign in at admin.microsoft.com with an account that has SharePoint Administrator or Global Administrator permissions.
In the left navigation, expand Admin centers and select SharePoint to open the SharePoint admin center.
Browse to the site or use Search, open the document library, select the Excel file, and choose Manage access or Details > Manage access to review users and groups.
Review the list of users with restricted or direct access, or generate a permission report from site permissions or Microsoft Purview audit tools as needed.

List SharePoint or OneDrive File Permissions with Microsoft Graph API
Use this solution when you need a scripted or repeatable permissions report and have Azure AD app registration and admin consent available.
Request a Network Share Permissions Report from Your Administrator
Use this for Excel files stored on a network share or file server where access is controlled by NTFS/ACL permissions and not by Excel VBA.
Use WPS Office as a Free Alternative for Excel Workbook Tasks
WPS Office cannot retrieve SharePoint or OneDrive permission lists through Excel VBA, but it is a free, lightweight Microsoft Office alternative that opens, edits, and saves Excel workbooks with familiar ribbon tools and strong .xlsx compatibility.
- 1. Download WPS Office: Go to the official WPS Office website and click Download WPS Office Free.
- 2. Install and launch WPS Spreadsheets: Run the installer, open WPS Office, and start WPS Spreadsheets.
- 3. Open your Excel workbook: Click Menu > Open, select the .xlsx file, and continue working with familiar formatting and formulas.

Frequently Asked Questions
Can Excel VBA read SharePoint file permissions directly?
No. Excel VBA does not have a built-in method to return SharePoint or OneDrive file permission lists. Use SharePoint admin tools or Microsoft Graph API instead.
What Microsoft Graph endpoint lists file permissions?
Use GET /drives/{drive-id}/items/{item-id}/permissions. You need an Azure AD app registration and Graph permissions such as Files.Read.All or Sites.Read.All.
How do I check restricted users for an Excel file on a network share?
Contact your network administrator and request a review of the shared folder permissions, NTFS ACLs, or effective access for the file path.
Does WPS Office provide a VBA feature to list restricted users?
WPS Office does not retrieve SharePoint or OneDrive permission lists through VBA. It focuses on opening, editing, and sharing Excel-compatible workbooks.
Is it safe to manipulate Excel file permissions with VBA?
It is not recommended. Direct permission changes through VBA can create security risks and may violate privacy and security policies.




