Workarounds for Word for Mac VBA File Dialogs Not Displaying
Question details
The user needs a workaround to select files via macros because standard Word VBA file dialogs fail to display correctly on macOS.

- Product
- Microsoft Word
- Device & OS
- Mac
- Scenario
- Running custom VBA macros that require the user to open or save files via a file selection dialog.
- Observed behavior
- Built-in Word VBA file dialogs, such as FileOpen and FileSaveAs, do not render or function correctly when executed.
Ensure that the Developer tab is enabled in your Word ribbon and that you have basic familiarity with editing VBA code and AppleScript.
Implement AppleScript for File Selection on Mac
Use macOS-native AppleScript commands executed through VBA to handle file and folder selection dialogs.
Because Office for Mac runs in a sandboxed environment, standard Windows VBA dialog commands often fail. Utilizing AppleScript allows you to tap into the native macOS file picker, ensuring the dialog displays correctly.
Launch Word for Mac, go to the Developer tab, and click on 'Visual Basic' (or press Option + F11) to open the VBA editor.
Find the section of your macro where Application.FileDialog, FileOpen, or FileSaveAs is currently being called.
Replace the Windows dialog code with a MacScript or AppleScriptTask function that calls a macOS 'choose file' or 'choose folder' string.

Create a Cross-Platform VBA File Dialog Routine
Write a dynamic VBA function that detects the operating system and automatically runs the appropriate file dialog method.
Try WPS Office for a Seamless Document Experience on Mac
If you frequently encounter complex compatibility issues or VBA scripting restrictions in Microsoft Word for Mac, consider switching to WPS Office. It provides a lightweight, fast, and highly compatible document editing environment that seamlessly handles standard Office files without the heavy resource footprint.
- 1. Download the Mac installer: Visit the official WPS Office website and download the free macOS installation package.
- 2. Install WPS Office: Open the downloaded file and drag the WPS Office icon into your Applications folder.
- 3. Open existing documents: Launch WPS Office and open your Word documents instantly with perfect format retention.

Frequently Asked Questions
Why does Application.FileDialog fail in Word for Mac?
Word for Mac operates within Apple's secure sandboxed environment, which strictly governs how apps interact with the file system. As a result, built-in Windows VBA file dialogs often get blocked or fail to render visually.
What is the difference between MacScript and AppleScriptTask?
MacScript is an older VBA function for running inline AppleScript, but it is heavily restricted in modern macOS versions. AppleScriptTask is the current Microsoft-recommended approach, which calls external AppleScript files safely stored in a designated user directory.
Can I use the same VBA macro for both Windows and Mac?
Yes. By using VBA compiler directives like '#If Mac Then', you can build a single macro that executes AppleScript on a Mac and standard Application.FileDialog on a Windows PC.




