Troubleshooting macro-enabled templates not applying content via the Header/Footer tool
Who is this article for?
Administrators applying macro-enabled templates using the Header/Footer tool.
Document module access is required.
This article explains how to resolve content application issues in the Header/Footer tool in macro-enabled templates.
Issue
If the Header/Footer tool shows a successful run with a macro-enabled template (.xlsm) but the document lacks the expected macro content, the issue is usually a syntax error in the template's macro, not the file type or tool compatibility.
A syntax error prevents the macro from running correctly. Although the tool may report success, the macro never executes on the target document, so no changes are applied or saved.
A frequent cause is a missing line continuation character ( _ ) in the VBA code. In VBA, lines broken across multiple lines must end with an underscore to indicate continuation; without it, the macro fails to run.
Example
A macro template contains a VBA line split over two lines without the line continuation character. Although the macro seems complete and the file opens normally, the Header/Footer tool fails to run it due to the syntax error.
The tool reports success, but the target document lacks the expected macro content.
Solution
To resolve this issue:
- Open the macro-enabled template file in the VBA editor.
- Review the macro code carefully for syntax errors, paying particular attention to any lines of code that span multiple lines.
- Confirm that each line break within a statement uses a line continuation character ( _ ) correctly.
- Correct any syntax errors found.
- Click Save.
- Update it in the system.
- Re-apply the corrected template to your target document using the Header/Footer tool.
- Open the resulting document.
- Confirm the macro content has been applied and is retained as expected.
Tip
If unsure about VBA syntax, use the VBA editor's compile check before saving. It flags many errors, like missing continuation characters, before applying the template.
If the issue persists after verifying the macro syntax, open a ticket with the template file and target document. This helps us determine if the problem lies with the macro code or the configuration.