Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: Thomas Winkel on January 26, 2014, 04:48:23 AM

Title: Global variable list
Post by: Thomas Winkel on January 26, 2014, 04:48:23 AM
Hi,

attached an example for a shape with a variable data field.
As new data is added to one shape it will directly be available via drop-down menu from the other shapes.

This is achieved by a User defined cell:
=CALLTHIS("ThisDocument.AddName")+DEPENDSON(Prop.Name)

AddName() is very simple:

Sub AddName(shp As Visio.Shape)
    ActiveDocument.DocumentSheet.Cells("Prop.Names").Formula = Chr(34) & shp.Cells("Prop.Name.Format").ResultStr(visNone) & Chr(34)
    shp.Cells("Prop.Name.Format").Formula = "=TheDoc!Prop.Names"
End Sub


The list is stored in a document property "Names".

Regards,
Thomas
Title: Re: Global variable list
Post by: Yacine on January 26, 2014, 08:14:00 PM
It's a very special case in which you would need your solution.
Usually, I'd just require the user to edit the list in the page's properties window.
but nicely done nevertheless.
Title: Re: Global variable list
Post by: Thomas Winkel on January 26, 2014, 10:31:39 PM
Hi,

my use-case would be electric terminals in a schematic drawing (Name -> Signal).
But at the moment this is just an experiment for fun to test the DEPENDSON() function which I discovered a few days ago.
There are ways to destroy the global list. So probably I will never use this in my project.
Anyhow, its really fun to develop such little things in Visio, more than Excel VBA.

Btw. today I've read your comic strips. "This is because *crazy mathematics*"... So funny, thanks for sharing  ;D