Minimize a Word Window from an Excel VBA Macro on Mac
Question details
The user wants to minimize Word while an Excel VBA macro creates a large number of labels on a Mac.

- Product
- Microsoft Excel and Microsoft Word
- Device & OS
- macOS
- Scenario
- An Excel VBA macro opens Word and creates a label document.
- Observed behavior
- The Word window remains visible while the macro runs, and attempts to hide it have not worked as expected.
Open the Excel workbook and locate the macro that creates the Word label document. Confirm that the code has references to the Word application and the newly created document.
Minimize the active Word document window
Use this approach after the macro creates and activates the Word label document.
Set the window state on Word's active window rather than relying on the document window's Visible property. The example uses the numeric Word minimize value, which avoids requiring a Word constant in Excel.
In Excel, open the VBA editor and find the procedure that calls Wrd.MailingLabel.CreateNewDocument.
Immediately after creating the document, add these lines, using your own variable names if they differ: Set oDoc = Wrd.MailingLabel.CreateNewDocument oDoc.Activate Wrd.ActiveWindow.WindowState = 2
Run the procedure from Excel and check that the Word document window minimizes after it opens. Continue testing the label-generation process on your version of Office for Mac.

Edit label documents and spreadsheets with WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for working with documents and spreadsheets. Its Microsoft Office format compatibility can help you move existing files, although it does not fix or replace the Word automation in this Excel VBA macro.

Frequently Asked Questions
Where should I add the minimize command?
Add it in the Excel VBA procedure after the line that creates the Word document. Activate the document first, then set Wrd.ActiveWindow.WindowState to 2.
Why use a Word window-state value instead of an Excel constant?
The target is a Word window, so its WindowState expects a Word WdWindowState value. The numeric value 2 represents wdWindowStateMinimize and can be used without a Word library reference.
Will turning off ScreenUpdating minimize Word?
No. ScreenUpdating controls screen refreshes, not the window's minimized state. You can test Wrd.ScreenUpdating = False for performance, but restore it to True when the macro finishes, including after an error.
Can WPS Office fix this Microsoft Word automation issue?
No. The solution changes the Word window state in the existing Microsoft Office VBA macro. WPS Office is an alternative for editing compatible documents and spreadsheets, not a fix for that automation.




