How to automate data updates in Visio diagrams when connected to external sources?

Charles 140 Reputation points
2026-01-07T11:51:45.92+00:00

I’m working with Visio diagrams linked to Excel/SQL data, and I want to understand how to reliably refresh and update shapes automatically when the source data changes, without manually re-linking or re-importing the data each time.

Microsoft 365 and Office | Visio | For business | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Flora-T 9,125 Reputation points Microsoft External Staff Moderator
    2026-01-07T13:59:43.9966667+00:00

    Hi Charles

    Thank you for reaching out to Microsoft Q&A Forum and sharing your question about automating data updates in Visio diagrams linked to Excel or SQL.

    To clarify, Visio is designed to maintain the connection string, so you don't need to re-import data unless the source file location or SQL credentials change.

    If your diagram is linked to an external data source (Excel, SQL, SharePoint lists), you may consider built-in refresh options:

    • Use Data > Refresh Data to update linked shapes manually.
    • To automate updates, select Configure Refresh and set an interval for automatic refresh. Ensure you define a unique identifier (key column) so Visio can match rows correctly during refresh.
    • For your reference: Refresh imported data - Microsoft Support.

    Standard refresh updates shape data and graphics but does not add or remove shapes when rows are added or deleted.

    If you need shapes created or removed automatically, consider Data Visualizer templates (available in Visio Plan 2). These templates can regenerate flowcharts or org charts from Excel when data changes, though layout adjustments may occur after refresh. Always maintain a stable unique ID in your source to avoid broken links.

    For advanced automation, Visio supports VBA macros using the DataRecordset.Refresh method to programmatically refresh linked data from external sources like Excel or SQL. This requires Visio Professional or Plan 2 with VBA enabled. Note that this method updates data in linked shapes only. For further details: DataRecordset.Refresh method (Visio) | Microsoft Learn.

    Please let me know how you get on, as your feedback is valuable to the community. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-01-07T11:52:54.3366667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To automate data updates in Visio diagrams that are linked to external sources like Excel or SQL databases, you can utilize the DataRecordset object in Visio. Here are the key steps to achieve reliable automatic refreshes:

    1. Set Refresh Interval: The DataRecordset.RefreshInterval property can be set to a positive value (in minutes) to specify how often the data should be refreshed automatically. The minimum interval you can set is one minute. By default, this property is set to 0, which means that the data does not refresh automatically.
    2. Programmatic Refresh: You can call the DataRecordset.Refresh method to refresh the data programmatically. This method executes the query associated with the data recordset and updates the linked shapes with the latest data.
    3. Handling Conflicts: When refreshing data, conflicts may arise if the data source has changed (e.g., rows have been added or removed). You can manage these conflicts by setting the DataRecordset.RefreshSettings property to customize how conflicts are handled, such as disabling the UI for reconciling refresh conflicts.
    4. Automatic Linking: If you want to link shapes and data automatically, you can use the AutomaticLink method, which helps in establishing links based on matching shape attributes and data columns.
    5. Visio Services in SharePoint: If you are using Visio Services in SharePoint, you can configure the Visio Web Access Web Part to refresh automatically based on user interactions or set intervals, ensuring that the diagrams reflect the latest data from the connected sources.

    By following these steps, you can ensure that your Visio diagrams remain up-to-date with the external data sources without needing to manually re-link or re-import data each time changes occur.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.