logo
search
Others

How to Fix Visio Not Creating Shapes After External Data Refresh

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

Question details

The user needs Visio to automatically generate corresponding shapes on the canvas when new rows are added during a SQL external data refresh.

Product
Microsoft Visio
Device & OS
not provided
Scenario
Refreshing linked SQL data in a Visio diagram and expecting new shapes to automatically appear for newly added database rows.
Observed behavior
Newly added rows successfully appear in the External Data window, but they are not automatically created as shapes on the canvas; they currently require manual drag-and-drop.
Before you start

Verify that your Visio diagram is successfully connected to the SQL database and that the External Data window correctly displays the newly added rows after a manual refresh.

Solution 1Recommended

Automate Shape Creation Using VBA

Since standard Visio data linking does not automatically add or remove shapes, you can use Visual Basic for Applications (VBA) to script the automation of shape generation after a data refresh.

By default, Visio's data linking is designed to update data fields on existing shapes rather than modify the canvas layout. Writing a custom VBA macro allows you to bypass this limitation and programmatically drop new shapes when unlinked rows are detected.

1
Enable the Developer Tab

Open Visio, go to File > Options > Customize Ribbon, and check the box next to 'Developer' in the right-hand column to make the Developer tab visible.

2
Access the VBA Editor

Navigate to the Developer tab on the ribbon and click on 'Visual Basic' to open the VBA Editor.

3
Create the Automation Script

Write a macro that loops through your target DataRecordset. Use the script to identify unlinked rows and execute the 'Page.Drop' command to place corresponding shapes onto the active canvas.

4
Run the Macro After Refresh

After refreshing your SQL external data, run your custom macro to automatically populate the new shapes based on the newly added rows in the External Data window.

VBA Knowledge Required: This solution requires familiarity with VBA programming and the Visio Object Model to properly map recordset rows to specific master shapes.
Free Microsoft Office alternative

Create Professional Diagrams Easily with WPS Office

If managing external data links and writing complex VBA scripts in Microsoft Visio feels overwhelming, consider WPS Office for your diagramming and documentation needs. As a free, lightweight, and user-friendly Microsoft Office alternative, WPS Office provides built-in flowchart tools, seamless migration, and excellent compatibility with standard Office formats.

  1. 1. Download and Install WPS Office: Visit the official WPS Office website to download the free suite and install it on your device.
  2. 2. Create a New Diagram: Open WPS Office, create a new document, and navigate to the Insert tab to access built-in flowchart and diagramming tools.
  3. 3. Customize Your Shapes: Easily drag and drop shapes, customize text, and connect elements to create professional diagrams without complex data linking setups.
Built-in flowchart and diagramming capabilities without needing external scriptsFully compatible with Microsoft Word, Excel, and PowerPoint formatsLightweight application that runs smoothly on most devicesFree to use with a highly familiar user interface for quick onboarding
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't Visio auto-create shapes when data is refreshed?

Standard Visio data linking is specifically designed to update the data fields on shapes that already exist on the canvas. It does not automatically modify the layout by adding or removing shapes when database rows change.

What is the Visio Data Visualizer?

Data Visualizer is a feature in Visio Pro that can automatically generate, add, and remove shapes for flowcharts, swimlane diagrams, and organizational charts directly from structured data.

Can I connect Visio Data Visualizer directly to a SQL database?

No, the Data Visualizer feature currently requires the data source to be in an Excel file. To use SQL data, you must first import the SQL data into Excel using Power Query, and then link Visio to that Excel workbook.