Fix Excel Macro Recorder Not Capturing Window Size or Position
Question details
The user needs to record a macro that sets the specific dimensions, screen position, or maximized state of the Excel application window, but the macro recorder does not capture these actions.

- Product
- Microsoft Excel
- Device & OS
- Mac
- Scenario
- Recording a macro that includes moving or resizing the Excel application window.
- Observed behavior
- The macro recorder entirely ignores changes made to the window's size, position, and maximized state, resulting in a VBA script that lacks the required window manipulation commands.
Ensure that the Developer tab is enabled in your Excel ribbon, as you will need to open the Visual Basic Editor (VBE) to manually insert the missing window sizing properties.
Manually Set Window Size and Position Using VBA Code
Because the macro recorder natively omits window sizing actions, you must edit the generated macro and manually define the application's properties.
The macro recorders in both modern Mac and Windows versions of Excel are primarily designed to capture cell data and formatting changes. They frequently fail to reliably capture application-level window changes. To successfully dictate where and how the window appears, you must write the size and position commands directly into your VBA script.
Press Option + F11 (on Mac) or Alt + F11 (on Windows) to open the VBA Editor, or click the 'Visual Basic' button located on the Developer tab in the ribbon.
In the left-hand Project Explorer pane, expand the 'Modules' folder and double-click the module containing the macro you just recorded.
Inside your macro sub-routine, insert 'Application.Top = 10' and 'Application.Left = 10' to explicitly set the starting position of the application window from the top-left corner of your screen.
Add 'Application.Width = 800' and 'Application.Height = 600' below the position commands to set the exact size of your Excel window in points.
If your goal is simply to have the window fill the screen rather than setting specific dimensions, use the command 'Application.WindowState = xlMaximized' instead.

Try WPS Office for Your Spreadsheet Needs
If you are frustrated by the limitations of the Excel macro recorder or dealing with inconsistencies between Mac and Windows versions, consider using WPS Office. It offers a highly compatible spreadsheet environment that handles complex data effortlessly without the heavy subscription costs.
- 1. Download and Install: Visit the official WPS website and download the free WPS Office suite for your Mac or Windows computer.
- 2. Open Your Workbooks: Launch WPS Spreadsheets and easily open your existing .xlsx or .xlsm files without losing data or formatting.
- 3. Utilize Familiar Tools: Navigate the intuitive interface to access all your formatting, data analysis, and charting tools exactly where you expect them to be.

Frequently Asked Questions
Why does the Excel macro recorder skip certain actions?
The macro recorder focuses on capturing user actions that manipulate workbook data and cell formatting. It intentionally ignores application-level environment changes, general UI navigation, and system-level window adjustments because they do not directly alter the spreadsheet's content.
How do I enable the Developer tab to edit my VBA code on a Mac?
Go to the 'Excel' menu at the top, select 'Preferences', then click on 'Ribbon & Toolbar'. In the right-hand list of main tabs, check the box next to 'Developer' and click Save to reveal the tab on your ribbon.
Can I use VBA to open the Excel window on a specific secondary monitor?
Yes, by setting the 'Application.Left' property to a point value greater than the resolution width of your primary monitor, the macro forces the Excel application window to render on your extended secondary screen.
Will macros recorded on Windows work seamlessly on Excel for Mac?
Basic macros managing cell data and calculations work across both operating systems. However, macros that interact with file paths, ActiveX controls, or OS-specific libraries will fail on Mac and require platform-specific conditional VBA code to function correctly.




