VBA & Macro Problems

How to Insert a Word Quick Tables Building Block by Macro

Huda QurayshiHuda Qurayshi Oct 26, 2026 868 views

Question details

The user needs a way to successfully insert a Quick Tables building block (like Calendar 1) using a Word VBA macro without manually opening the Quick Tables gallery first.

How to Insert a Word Quick Tables Building Block by Macro
Product
Word
Device & OS
not provided
Scenario
Automating document creation or formatting in Word using a VBA macro to insert pre-designed Quick Tables.
Observed behavior
The VBA macro fails to insert the requested Quick Tables building block unless the user has already opened the Quick Tables gallery manually during that session.
Before you start

Before modifying your macro code, ensure you have enabled the Developer tab in Word and saved a backup copy of your document or template.

Solution 1Recommended

Programmatically Load Building Block Templates via VBA

Use the LoadBuildingBlocks method in your VBA script to force Word to load all building block templates into memory before attempting the insertion.

To optimize startup performance, Microsoft Word delays loading building blocks (like Quick Tables, Headers, and Footers) into memory until they are manually accessed. This behavior causes VBA macros to throw an error if they try to insert a building block before the gallery has been initialized.

Adding a single line of code to load the templates beforehand ensures your macro can seamlessly find and insert the required Quick Table.

1
Open the VBA Editor

Press Alt + F11 to open the Microsoft Visual Basic for Applications (VBA) editor.

2
Locate Your Macro

In the Project Explorer, find and double-click the module containing the macro you use to insert the Quick Table.

3
Add the Load Command

Add the statement 'Application.Templates.LoadBuildingBlocks' directly before your existing insertion code.

4
Run the Insertion Command

Ensure your subsequent code uses the correct insertion syntax, such as 'BuildingBlockEntries("Calendar 1").Insert Where:=Selection.Range'.

Programmatically Load Building Block Templates via VBA
Template Availability: Ensure that the building block you are calling (e.g., "Calendar 1") actually exists and is available in the active Word template attached to your document.
Free Microsoft Office alternative

Looking for a Simpler Alternative to Microsoft Word?

If troubleshooting complex VBA macro errors and building block issues in Microsoft Word is slowing down your workflow, consider switching to WPS Office. It provides a lightweight, highly compatible alternative that makes formatting documents and inserting tables intuitive and hassle-free.

  1. 1. Download and Install: Visit the official WPS Office website to download the free installer for your operating system.
  2. 2. Open Your Documents: Launch WPS Writer and open your existing .docx files directly with full formatting preserved.
  3. 3. Use Built-in Features: Navigate to the Insert tab to add tables, cover pages, and text boxes effortlessly without relying on complex macros.
Free, lightweight, and fast document processingSeamless compatibility with Microsoft Word (.docx, .doc, .dotm) formatsEasily insert and manage built-in tables and templates without codingFamiliar ribbon user interface ensures zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro work only after I click the Quick Tables menu?

Word saves memory by not loading building blocks in the background until you manually open menus like Quick Tables or Cover Pages. Clicking the menu loads them, allowing your macro to suddenly work.

Can I use 'LoadBuildingBlocks' for other types of insertions?

Yes, Application.Templates.LoadBuildingBlocks will initialize all building blocks, making it useful before running macros that insert custom text boxes, headers, footers, or watermarks.

Where are Word Quick Tables building blocks stored?

Built-in Quick Tables are usually stored in the 'Built-In Building Blocks.dotx' template, while custom building blocks you create are typically saved in 'Building Blocks.dotx' or the 'Normal.dotm' template.