Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: yfayolle on August 20, 2008, 04:10:26 PM

Title: How can I know if page exists in visio document using text fields functions
Post by: yfayolle on August 20, 2008, 04:10:26 PM
Hello Visio guy,
I have a question about the text fields function. I want to create a text fields which it calculate the sum with the contain of shapes in the current page and other pages. I succed with this operation.

Ex:
Formula= SUM(SHAPETEXT(Sheet.89!TheText,0),SHAPETEXT(Pages[Page-2]!Sheet.90!TheText,0))
==> It's work good! But if an user delete the page2, the formula doesn't work because the reference on shape don't exist.
My question is: does it exist some tips to check if pagename exist before to calculate the sum?

I try another formula but when I delete the page 2, I get an error message.
Ex:
Formula=IF(ISERROR(SHAPETEXT(Pages[page-2]!Sheet.89!TheText),Page doesn't exist,Page exists)     

Any idea about that?
Yanne     




Title: Re: How can I know if page exists in visio document using text fields functions
Post by: vojo on August 20, 2008, 07:31:30 PM
ISERR

You may want to try to build a single string = concat of all pages/shapes.
Then parse as needed (lookup, find, etc)
user.sum=page 1&"!!"&page2&"!!"&page3
Then parse user.sum (lookup counting number of !! or some other marker you define).
Title: Re: How can I know if page exists in visio document using text fields functions
Post by: yfayolle on August 21, 2008, 04:10:42 PM
Thank you for your answer voyo.
I'm newer in the world of visio and I don't understand what you main when you say "user.sum".
I don't know where is this command. If you have any document or link about this issue, please give me it.
Ciao!
Title: Re: How can I know if page exists in visio document using text fields functions
Post by: vojo on August 21, 2008, 06:07:00 PM
in essence, behind every line or shape in visio is a 'spreadsheet" called a shapesheet.  Cells in this shapesheet control a variety of functions (location, color, formatting, intelligence/dynamics fo the shape, etc).  To config the cells, there are a bunch of functions (and, or, if/then, sine, cosine, lookup, etc).

So all I was suggesting is that you can use a cell called user.cell to build up a text string that has the concatentation of all the page numbers  (something like "page1!!page2!!page3!!page4).  You can then use functions like lookup in other user.cells against this one to find "page2" in this string.

If you are new to visio, this will take alot of learning (visio shapesheet and function mix are quite arcane).
Visio is definitely a crawl walk run tool