Fix VBA Sandbox File Access in Word 2016 for Mac
Question details
The user needs a Word 2016 for Mac VBA macro to access and open files outside its permitted locations.

- Product
- Microsoft Word 2016 for Mac
- Device & OS
- macOS
- Scenario
- A VBA macro requests permission to open files using GrantAccessToMultipleFiles and Documents.Open.
- Observed behavior
- Incomplete file paths can make the permission request appear ineffective or cause Documents.Open to fail.
Confirm that each target file exists and identify its full macOS path, including the actual user name. In Finder, select a file and choose File > Get Info to check its name and location.
Request Access Using Complete macOS File Paths
Use this approach when a Word VBA macro needs permission to open files outside its sandbox locations.
In Word, choose Tools > Macro > Visual Basic Editor, then open the module containing your macro.
Create an array of full, comma-separated paths, such as paths = Array("/Users/username/Desktop/test1.txt", "/Users/username/Desktop/test2.txt"). Replace username and the file names with the actual values on your Mac; do not leave the user name blank in a path such as /Users//Desktop.
Before calling Documents.Open, check the permission result in your macro: If GrantAccessToMultipleFiles(paths) Then followed by Documents.Open FileName:=paths(0), then Else, MsgBox "File access was not granted.", and End If on separate lines.
Run the macro from the VBA editor or Tools > Macro > Macros. When macOS or Word prompts for file access, approve the request, then check that the document opens.

Edit Word Documents with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and support for common Word formats, making it easy to move your documents. It does not fix Microsoft Word's sandbox permissions, and VBA macro compatibility may differ.

Frequently Asked Questions
Why does GrantAccessToMultipleFiles appear to do nothing?
Check that every entry in the array is a complete, valid path to an existing file. For example, replace /Users//Desktop/test1.txt with a path containing your actual macOS user name.
When should the macro request file access?
Call GrantAccessToMultipleFiles with the file path array before calling Documents.Open, and proceed only if the permission request returns True.
What happens if I deny the permission request?
The macro should not attempt to open the requested files when GrantAccessToMultipleFiles returns False. Run the macro again and approve the prompt if you want to grant access.
Can WPS Office fix Word's VBA sandbox permissions?
No. The permission issue belongs to Microsoft Word for Mac. WPS Office can open and edit DOC and DOCX files as an alternative, but its VBA macro compatibility may differ.




