VBA & Macro Problems

Fix an Excel for Mac Macro That Does Not Print the Workbook

Algirdas JasaitisAlgirdas Jasaitis Nov 18, 2026 870 views

Question details

The user needs a recorded macro to print after configuring page settings.

Fix an Excel for Mac Macro That Does Not Print the Workbook
Product
Microsoft Excel 2016 for Mac
Device & OS
Mac
Scenario
A recorded VBA macro sets up pages for printing a worksheet or workbook.
Observed behavior
The page settings are configured, but the macro does not contain a command to send the worksheet or workbook to the printer.
Before you start

Open the workbook in Excel for Mac and make sure a printer is available. Identify whether you want to print only the active worksheet or the entire workbook.

Solution 1Recommended

Add a PrintOut command to the Excel VBA macro

Use this solution when the macro changes page settings but does not issue a print command.

1
Open the VBA editor

In Excel, open the workbook and select Tools > Macro > Visual Basic Editor.

2
Find the recorded macro

In the Project window, open the module containing the recorded macro and locate its page-setup code.

3
Add the print command

After the page-setup code and before End Sub, add ActiveSheet.PrintOut to print the active worksheet. To print the entire active workbook instead, use ActiveWorkbook.PrintOut.

4
Run the macro

Return to Excel, select Tools > Macro > Macros, choose the macro, and click Run. Check that the intended worksheet or workbook is sent to the printer.

Add a PrintOut command to the Excel VBA macro
Choose the correct print scope: ActiveSheet.PrintOut prints the active sheet, while ActiveWorkbook.PrintOut prints the active workbook. Make sure the intended sheet or workbook is active when the macro runs.
Free Microsoft Office alternative

Print spreadsheets with WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for Microsoft Excel formats, making it easy to move everyday spreadsheet work. You can use its print options to print sheets without relying on the Excel macro; it does not repair Excel VBA code.

Print spreadsheet pages using familiar print optionsOpen and edit Microsoft Excel formats such as XLSXUse a familiar interface for everyday spreadsheet workMove common Office tasks to a free, lightweight suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my recorded Excel macro change page settings but not print?

Page-setup commands only configure how the pages will look. Add a PrintOut command after those settings and before End Sub to send the output to the printer.

How do I print only the active worksheet from VBA?

Add ActiveSheet.PrintOut after the page-setup code. Before running the macro, select the worksheet you want to print.

How can I print the whole workbook instead of one sheet?

Use ActiveWorkbook.PrintOut in the macro instead of ActiveSheet.PrintOut, and make sure the intended workbook is active when you run it.

Where can I edit the recorded macro in Excel for Mac?

Open the workbook, select Tools > Macro > Visual Basic Editor, and open the module containing the macro in the Project window.