Global variable list

Started by Thomas Winkel, January 26, 2014, 04:48:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thomas Winkel

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

Yacine

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.
Yacine

Thomas Winkel

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