Office for Mac Issues

Fix VBA Sandbox File Access in Word 2016 for Mac

Camila MilosovichCamila Milosovich Nov 22, 2026 868 views

Question details

The user needs a Word 2016 for Mac VBA macro to access and open files outside its permitted locations.

Fix VBA Sandbox File Access in Word 2016 for Mac
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.
Before you start

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.

Solution 1Recommended

Request Access Using Complete macOS File Paths

Use this approach when a Word VBA macro needs permission to open files outside its sandbox locations.

1
Open the VBA editor

In Word, choose Tools > Macro > Visual Basic Editor, then open the module containing your macro.

2
Add complete file paths

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.

3
Request access before opening

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.

4
Run and approve the request

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.

Request Access Using Complete macOS File Paths
Check every path: Each array entry must point to an existing file. If access is denied or a path is incorrect, correct the path or permission and run the macro again.
Free Microsoft Office alternative

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.

Open and edit documents without relying on a Word VBA file-opening macroCompatible with Microsoft Word DOC and DOCX filesFamiliar editing interface for an easier transitionFree and lightweight for everyday document work
microsoft office alternative - wps office

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.