• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • Visio Shape Report Converter
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network
You are here: Home / Shape Design / ShapeSheet Formulas / Forcing Display Update of Inherited Data Values

Published on October 20, 2021 by David Parker

Forcing Display Update of Inherited Data Values

I was going to title this “When is a truth not a truth?” because I have found that Visio can sometimes refuse to apparently update the displayed value in a cell, even though it has been changed. However, this was, in this instance, down to a misunderstanding of the formula evaluation events on my part. Take the scenario where you have some data that you want to be available to all pages and all shapes in the Visio document. There are some built-in Document Properties in Visio that are accessible to all pages and shapes using ShapeSheet functions ( eg TITLE(), SUBJECT(), COMPANY(), Categories / CATEGORY(), Tags / KEYWORDS(), Comments / DESCRIPTION(), Author / CREATOR(), MANAGER() and HYPERLINKBASE()). However, Visio does not have custom Document Properties like the other Office applications. Instead, Visio allows for the addition of User-Defined Cells and Shape Data rows in the DocumentSheet of the document. These can be uniquely named, and Shape Data rows can be given a data type (of sorts), a label, prompt and format.

These values can be accessed via a ShapeSheet function from anywhere within the document, which ensures that you only have one version of the truth. However, there is no non-developer user-interface to edit these DocumentSheet Shape Data values in Visio, so what do you do? And how can you be sure that you are always seeing these centralised values correctly?

I created the following master shape to test how this can be done. It is a group shape that contains a single StartDate Shape Data row, which is used to edit or view the date in the similarly named Shape Data row in the DocumentSheet. For good measure, I also added a similarly named Shape Data row to the page, so the Shape Data window in the page could also be used. I then used Insert / Field to display the values in the ShapeSheet, PageSheet and DocumentSheet:

The easiest way to provide a user-interface to the Shape Data rows of the DocumentSheet is to create a shape that contains the same rows, but the Label, Prompt, Type, Format, etc gets the values from the same cells in the DocumentSheet by using the TheDoc! prefix, eg:

=TheDoc!Prop.ShapeData.Label

This is not suitable for the Value cell because the user needs to edit this in the UI, and all other references to the value need to get the latest value.

Date fails to display correctly

Initially, I merely used the SETATREF(…) function in the Value cell of the Prop.StartDate row of the master shape.

 =SETATREF(TheDoc!Prop.StartDate)

This function will push the value to the target cell, in this case the Prop.StartDate.Value cell in the DocumentSheet. However, I soon noticed that displayed values from the ShapeSheets and the PageSheet did not always show the value correctly. Indeed, the shape is selected in the following screenshot, and the Shape Data window shows that the value is the 11 Oct. 21, but the group shape display 5/10/2021 (UK short date format), and the sub-shape displays 18 Oct. 21! If I move the shape, then the sub-shape display automatically updates to show the correct date.

So, there has to be a way of ensuring that the correct values are displayed. I found two, one is probably the official way, and the other is my workaround.

The Official Way

The official way, if you study the SETATREF(…) function guide, is to use SETATREFEVAL(…) and SETATREFEXPR(…) functions the second argument. This forces the cell to be evaluated before assigning the value to the target cell, so the formula becomes:

=SETATREF(TheDoc!Prop.StartDate,SETATREFEVAL(SETATREFEXPR()))

However, this does force the value to become local, as can be seen by the blue colour of the formula in the Prop.StartDate.Value cell in the following screenshot:

The Workaround

Another option, which I have used, is to force the cell to re-inherit the formula from the master when it is dropped onto the page. This can be achieved with the following formula in the EventDrop cell:

=IF(STRSAME(LEFT(MASTERNAME(),1),"<"),0,SETF(GetRef(Prop.StartDate),"="))

The purpose of the IF() part is to only act when the shape is dropped on the page, not when the master edit window is open, otherwise pushing the “=” formula into the Prop.StartDate.Value cell will force it to re-inherit from the master shape cell. (Note that the .Value cell is the default, so it does not need to be specified).

Notice that the Value cell is still black, which means that it is inherited from the master shape cell:

Post script

I still feel that it is wrong for Visio to not update the display to match the actual value in a cell, and especially as the documentation says that SETATREF(…) does support the Shape Data rows.

Pushing Data Visualizer in Visio beyond its limits

My last post was about some of the lessons learnt when trying to push Data Visualizer to its limits, but this one has some ways of overcoming these limitations. The main lesson learnt is that DV binds the shapes within the DV container shape, CFF Data Visualizer, and controls some of the ShapeSheet cells that…

Pushing Data Visualizer in Visio to the limits!

Regular readers of my blog will know that I like to use the Data Visualizer (DV) in Visio Plan 2, but I recently tried to help a user who really decided to push it to the limits. In this scenario, there were multiple connections, but with different labels, being created between the same flowchart shapes,…

Setting Theme defaults in Visio

I was recently asked how to change the default font size and line weight in Visio, and then saw then many others are asking the same sort of question. I found one reasonable answer suggesting that you should create a new document from your required template, then edit the Styles to suit, and then save…

Taking Visio Actions Rows to the limit

I recently (re-)discovered that there is a limit to the number of Actions section rows that will be evaluated for display on the right mouse menu of a Visio shape. I have not hit a limit (yet) for the number of rows that can be added to the Actions section … so why is there…

A Multi-Time Zone Clock for Visio

I wrote a post about making a clock face in Visio fifteen years ago, but a reader recently asked about displaying multiple time zones. Well, I have previously written about time zones in Visio, so I accepted the challenge to improve upon my earlier work. (more…)

Update any Visio ShapeSheet cell with External Data

When Microsoft introduced a new way of linking external data to Visio shapes in 2007, I initially bemoaned the inability to update anything but Shape Data row values, unlike the old database add-on that I had been using for 10 years. The new method, though, has many advantages over the old way, not least that…

Related

Filed Under: Shape Data, ShapeSheet Formulas, Visio Tagged With: Shape Data, Shape Design, ShapeSheet Functions, Visio

About David Parker

David Parker has 25 years' experience of providing data visualization solutions to companies around the globe. He is a Microsoft MVP and Visio expert.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • Pushing Data Visualizer in Visio beyond its limits
  • Pushing Data Visualizer in Visio to the limits!
  • Teams Tuesday Podcast Recording about Visio
  • Linking Data to Visio Shapes in Code
  • Editing Visio Layer Colours with LayerManager

Categories

Tags

Accessibility Add-Ins Connectors Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript Layers Legend Link Data to Shapes Lists MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Themes Validation VBA Video Visio Visio 2007 Visio 2013 Visio for the Web Visio Online Visio Services Visio Viewer Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • LinkedIn
  • Twitter

Search this website

Recent posts

  • Pushing Data Visualizer in Visio beyond its limits
  • Pushing Data Visualizer in Visio to the limits!
  • Teams Tuesday Podcast Recording about Visio
  • Linking Data to Visio Shapes in Code
  • Editing Visio Layer Colours with LayerManager

Copyright © 2023 · Executive Pro on Genesis Framework · WordPress · Log in