User cell with formula: =Pages[Page-1]!Sheet.1!ID() when Shape no longer exists

Started by Visisthebest, November 02, 2021, 09:45:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

I notice that if I have a formula like this in the Document shapesheet user section:

=Pages[Page-1]!Sheet.1!ID()

That when I delete the shape the formula is removed and the ID of the no-longer-present shape is put in as a value only.

Is this behavior like this in Visio at least since Visio 2010?

This is a good way for me to check if a key shape is deleted by the user, I can just check if the formula is still there, if it is removed I know the shape is deleted.

(the key shape can be somewhere on a set of pages, hence storing it in the document it is not bound to a specific page)

Is there a shapesheet function that I could use to check for the missing formula and actually put a text like "ShapeDeleted" in a user cell? Even more elegant solution that way.

(if the user renames the page the shape formula is also 'invalidated' but that is a fine trade-off in this scenario, I assume I cannot use Page ID as a way to reference a page in a shapesheet formula)


Visio 2021 Professional

Surrogate

Quote from: Visisthebest on November 02, 2021, 09:45:39 AM
Is there a shapesheet function that I could use to check for the missing formula and actually put a text like "ShapeDeleted" in a user cell? Even more elegant solution that way.
May be ISERROR-function?
Quote from: Visisthebest on November 02, 2021, 09:45:39 AM(if the user renames the page the shape formula is also 'invalidated' but that is a fine trade-off in this scenario, I assume I cannot use Page ID as a way to reference a page in a shapesheet formula)
if you have formula which have current page name, when user rename page first time - your exist formula automatically updated. If user change pagename one more formula still unchanged and correct. Because universal PageName dont changed, after first renaming...
Quote from: Surrogate on October 21, 2021, 04:12:01 AM

After renaming of page local (name as user can see) and universal (name as Visio engine know) page names are different !



English interfaceRussian interface
My favorite pictures for explainings

Visisthebest

Thank you Surrogate ISERROR() exactly what I was looking for!

Good to know about the page (universal) name and what happens on renames by the user thank you!
Visio 2021 Professional

Visisthebest

Surrogate ISERROR() in another cell that evaluates the cell with the formula: =Pages[Page-1]!Sheet.1!ID()

stays false, as Visio, when the shape being referenced is deleted, just puts a value of the deleted shape's ID there which still evaluated to FALSE.

Good idea but in this case I just need to check if the cell contains a complete formula or just an ID value, as that way I know if the shape is delete (no formula = shape was deleted).
Visio 2021 Professional

wapperdude

Visio 2019 Pro

Surrogate


wapperdude

@Surrogate:  apologies, old habits hard to change, especially for old dawgs!
Visio 2019 Pro

Surrogate

@wapperdude

Nothing new   :)
I simply added a little to the classification by Graham Wideman presented in the book "MS Visio 2003 Developer's Survival Pack"