Creating Shape to Page Hyperlinks Automatically using Link Data to Shapes

I demonstrated how to import hyperlinks into Visio shapes in a previous post – see, however, one of my readers wanted to know if the same mechanism can be used to create an hyperlink to another page in the same Visio document, rather than to an external web page. Well, it can be done … with a little preparation.

The Link Data to Shapes feature will by default only create external links because it pushes values from designated Shape Data fields into Hyperlink rows. You can designate Shape Data columns by ticking the Data Type / Hyperlink checkbox:


In my example, I have put the values Page-1 or Page-2 in the Link column, and set this Data Type as String Hyperlink, and this sets an Hyperlink with an Address Page-1 or Page-2. However, other pages, and shapes, are entered into the Sub-address property, but Visio prevents you from setting this if there is anything in the Address property.


So, the challenge is push the Address values into the Sub-address automatically.

Fortunately, the name of the Hyperlink row is predictable because it is named according to the Label of the Shape Data row, with a prefix _VisDM_. Therefore, the Link Shape Data row will create an Hyperlink row named Hyperlink._VisDM_Link. Knowing this, you can prepare a Master shape to be linked to the data with some ShapeSheet formulas.

The first action is to create the named Hyperlink row in the master shape. Then I created two User-defined cells with some ShapeSheet formulas in them.


The first User-defined cell is called LinkTrigger, and this contains the formula to move the Address to the Sub-address cell, if the Address does not start with http :


The second User-defined cell is called LinkInvisibleTrigger, and this is required to reset the Invisible cell formula because the Link Data to Shapes feature will put the formula =LEN(Hyperlink._VisDM_Link.Address)=0 into that cell, and this will hide your carefully constructed Sub-address hyperlink:


These two User-defined cell formulas will ensure that the data-linked shape will get an hyperlink to another page in the document (provided that you have entered a valid page name!).


You should be aware that the hyperlinks will not get automatically updated if you change the names of the pages. You should go back to your data source and update the values there before refreshing the shapes from it.

The hyperlink will be available from the right-mouse menu of each shape:


As an optional extra, you could use the following formula in User.LinkTrigger value cell if you want to also modify the Double-Click event of the shape to automatically go to the page:




5 Responses to “Creating Shape to Page Hyperlinks Automatically using Link Data to Shapes”

  1. shawnhishere Says:

    This worked beautifully – for some reasone the double click code isn’t working though.


    Please advise what’s wrong.

  2. shawnhishere Says:

    I was able to get the code to take, however, I double click and nothing happens. Am I supposed to put this same formula in the EventDblClick tab? if not, what am I supposed to put in that tab?

  3. Paul Hofmann Says:

    I am attempting this in Visio Pro 2013, but get “Error in formula.” when attempting to save either the LinkTrigger orLinkInvisibleTrigger formulas.

  4. Paul Hofmann Says:

    An alternative, working for me in Visio Pro 2013, is to specify the page link as “MyDiagram#MyPage” along with setting the Data Type as String Hyperlink. That value goes into the Address field, and there is no need to move it to Sub-address.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.


O365 and SharePoint

Simplify Tasks

Want to learn the simple way?

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

John Goldsmith's visLog

be smart, be clear, be visual ...

Mo's blog

Personal views on Dynamics 365 for Operations and Technical Architecture.

Chris Webb's BI Blog

Microsoft Power BI, Analysis Services, MDX, DAX, M, Power Pivot and Power Query

Azure Solutions for Office 365, and more...

Rob Fahrni



Life with Visio and other Microsoft Toys!

Nilsandrey's Weblog

Just another weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Smart graphics for visual people

%d bloggers like this: