Aug 10 2023 12:41 AM
Aug 10 2023 02:12 AM
In Excel 365, using VBA to directly get a list of users who have limited access to a file is not easy. The built-in VBA functions in Excel do not provide direct access to this type of information.
Restricted access may affect permissions and security settings managed by the file's hosting environment (e.g. SharePoint, OneDrive or a network share), and Excel's VBA may not have access to this information.
However, if restricted access is implemented within the Excel file itself (e.g. by using VBA to restrict access to certain sheets or functions), you may be able to create a mechanism to track user interactions and information about users to collect access to restricted portions of the file. But this also depends on the Excel versions that other users use.
If you're working in a shared environment like SharePoint, OneDrive, or a network share, you might need to use a different approach:
If you are dealing with restricted access within SharePoint or OneDrive, you may need to use SharePoint/OneDrive APIs or admin tools to get access information. These typically require administrative access and API calls using programming languages such as PowerShell or C#.
When working with a file on a network share, you may need to use network management tools to gather information about file access permissions.
Keep in mind that access to user-specific information, particularly those related to security and access, often involves administrative privileges and can have privacy implications. Make sure you follow the necessary security and privacy policies when attempting to collect this type of information.
The text was created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Always keep in mind that manipulating user permissions and access rights directly via VBA may introduce security risks or unintended consequences. It is best to handle such tasks with the appropriate management tools and procedures provided by the file hosting environment.