Visio Guy

Visio Discussions => Programming & Code => Topic started by: Kieron on November 24, 2022, 09:54:18 AM

Title: VBA to automatically update Visio drawing when Excel file is edited
Post by: Kieron on November 24, 2022, 09:54:18 AM
Hi,

I am a beginner when it comes to using VBA in Visio.

I have a Visio drawing, as well as an Excel Export shape report of the drawing (both attached)to help explain my question.

What I am wondering is, would it be possible to manually change values in the "Displayed Text" column in the excel file (ShapeReport), and have a VBA Macro that would automatically import the data into the Visio drawing, and update the Visio drawing accordingly, changing the text of shapes and connectors etc. ?

I know there are posts on here relating to building a Visio drawing from an Excel file, but what I need to do is work on an already existing Visio Diagram and Excel File, to try and maintain consistency between both the files, so when the Excel changes so does the Visio.

I hope this makes sense.

Many thanks :)

EDIT: I understand you can add DataGraphics to shapes that can automatically update from external data sources, but this is not what I am hoping to achieve. I am trying to physically edit the Text of shapes and connectors, when text changes in an external Excel file.
Title: Re: VBA to automatically update Visio drawing when Excel file is edited
Post by: Surrogate on November 24, 2022, 11:00:41 AM
Quote from: Kieron on November 24, 2022, 09:54:18 AM
I know there are posts on here relating to building a Visio drawing from an Excel file, but what I need to do is work on an already existing Visio Diagram and Excel File, to try and maintain consistency between both the files, so when the Excel changes so does the Visio.
If you use Visio 2007+ Professional you can use Data Linking
https://youtu.be/0FDq596M7KA (https://youtu.be/0FDq596M7KA)