Author Topic: How can I know if page exists in visio document using text fields functions  (Read 3849 times)

0 Members and 1 Guest are viewing this topic.

yfayolle

  • Newbie
  • *
  • Posts: 2
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     





vojo

  • Hero Member
  • *****
  • Posts: 1528
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).

yfayolle

  • Newbie
  • *
  • Posts: 2
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!

vojo

  • Hero Member
  • *****
  • Posts: 1528
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