logo
search
Office for Mac Issues

Fix Word for Mac Error 6304 When Opening Old Documents via VBA

Algirdas JasaitisAlgirdas Jasaitis Oct 9, 2026 869 views

Question details

The user is encountering runtime error 6304 in Word for Mac when trying to use a VBA macro to open older Word documents.

Fixing Word for Mac Error 6304 When Opening Old Documents with VBA
Product
Word for Mac
Device & OS
macOS
Scenario
Running a VBA macro to batch-process or open very old Word document files on a Mac.
Observed behavior
Word for Mac throws runtime error 6304, preventing the macro from opening the files. This is typically caused by missing file extensions, incorrect macOS file associations, or macOS sandbox restrictions blocking automated access.
Before you start

Ensure you have full administrator access on your Mac to modify file extensions and adjust privacy permissions, and make a backup copy of your old documents before running batch-processing macros.

Solution 1Recommended

Add Correct File Extensions and Fix Associations

Old Mac files often lack extensions. Adding the correct extension and associating the files with Microsoft Word resolves macro access errors.

Older classic Mac OS files used Type and Creator codes instead of extensions. Modern versions of Word for Mac require explicit extensions (like .doc or .docm) to programmaticly open them via VBA without triggering error 6304.

1
Locate the old documents

Open Finder and navigate to the folder containing the old Word documents you want to process.

2
Add the correct extension

Rename the files to include the proper extension. Use .doc for standard old Word documents. If the file contains macros itself, use .docm or .dotm.

3
Update macOS file associations

Right-click one of the renamed files, select 'Get Info', and scroll down to 'Open with'. Select Microsoft Word from the dropdown menu, then click 'Change All' to apply this association to all similar files.

Add Correct File Extensions and Fix Associations
Macro Formats: Never save macro-enabled files with a .docx extension, as this format cannot store VBA code. Always use .docm for documents or .dotm for templates.
Free Microsoft Office alternative

Try WPS Office for a Seamless Mac Document Experience

If you continue to experience macro errors, sandbox issues, or legacy file compatibility problems in Microsoft Word for Mac, WPS Office offers a highly compatible and lightweight alternative. It natively supports legacy formats and VBA, making document processing hassle-free.

  1. 1. Download WPS Office: Visit the official WPS website and download the free macOS installer.
  2. 2. Open legacy files: Launch WPS Writer and navigate to Menu > Open to locate your old document files.
  3. 3. Edit and save: Easily edit your legacy documents and save them in modern formats like .docx without sandbox restrictions.
Excellent format compatibility with Microsoft Office (.doc, .docx, .docm)Free and lightweight alternative specifically optimized for Mac usersSeamless migration with a familiar user interface and zero learning curveRobust support for opening and managing legacy document files
microsoft office alternative - wps office

Frequently Asked Questions

Why do old Word files lack file extensions on Mac?

Older classic Mac OS versions relied on internal Type and Creator codes to identify file types rather than file extensions. When these older files are opened on modern macOS, they may lack the .doc extension, causing VBA macros to fail.

Can I save a file with macros as a .docx file?

No. The .docx format is specifically designed for macro-free documents. If your document contains VBA code, you must save it as .docm (macro-enabled document) or .dotm (macro-enabled template) to preserve the scripts.

What is a macOS sandbox restriction?

macOS sandboxing is a security feature that limits an application's access to system resources and user data. Because Microsoft Word is sandboxed, its VBA macros cannot automatically open files without you first granting explicit system permission to access that specific file or folder.