VBA & Macro Problems

How to Create an Excel Macro-Enabled Template (.xltm) with Print Buttons

John WilsonJohn Wilson Nov 10, 2026 869 views

Question details

The user needs to save a workbook containing VBA print buttons as a template without losing macro functionality.

Product
Excel
Device & OS
not provided
Scenario
Saving a workbook with custom VBA macros as a reusable template for daily work.
Observed behavior
Saving the file as a standard Excel template (.xltx) causes macro-related errors and removes the VBA print button functionality.
Before you start

Ensure that all your VBA code and form controls, such as your print buttons, are functioning correctly in the current workbook before attempting to save it as a reusable template.

Solution 1Recommended

Save as an Excel Macro-Enabled Template (.xltm)

Saving the file with the .xltm extension ensures that all embedded VBA macros, including your print buttons, are preserved for future use.

Standard Excel templates (.xltx) intentionally strip out macros for security reasons. To keep your VBA procedures intact, you must use the specific Macro-Enabled Template format.

1
Open the Save As dialog

Click on the 'File' menu in the top left corner of your Excel window and select 'Save As'.

2
Select the correct format

Click on the 'Save as type' drop-down menu and choose 'Excel Macro-Enabled Template (*.xltm)'.

3
Choose your save location

Select your preferred folder (the default 'Custom Office Templates' folder is recommended for easy access) and click 'Save'.

Save as an Excel Macro-Enabled Template (.xltm)
Template Ready: When users open this .xltm file, it will automatically generate a fresh workbook containing all original VBA macros and print buttons, preventing overwrites of the original template.
Seamless Macro Support

Create Macro-Enabled Templates in WPS Spreadsheet

WPS Office offers robust support for spreadsheet macros and form controls. You can easily create, run, and save macro-enabled templates (.xltm) with custom VBA print buttons directly in WPS Spreadsheet.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your VBA macros and print buttons.
  2. 2. Access the Save menu: Click the 'Menu' button in the top left corner and hover over 'Save As'.
  3. 3. Save as .xltm: Select 'Excel Macro-Enabled Template (*.xltm)' from the file type options, choose your destination folder, and click 'Save'.
Fully compatible with Microsoft Excel .xltm, .xlsm, and .xls formatsSupports VBA macros and custom form controls like Print buttonsLightweight, fast, and features an intuitive, tabbed user interface
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get a warning when saving my macro workbook as a standard template (.xltx)?

Standard Excel templates (.xltx) are designed to be macro-free for security reasons. If you try to save a workbook containing VBA code as an .xltx file, the software will prompt a warning and strip the macros to comply with the format restrictions.

How do users open the .xltm template to create a new file?

Users simply need to double-click the .xltm file from their file explorer. By default, the software will use it as a mold to generate a brand new, unsaved workbook (e.g., Book1) that contains all the macros and buttons from the template.

Can I edit the original .xltm template after saving it?

Yes. To edit the template itself rather than creating a new document, you must open your spreadsheet software first, go to File > Open, and browse to select your .xltm file. Alternatively, you can right-click the template file in your folder and select 'Open' instead of 'New'.