Visio Guy

Visio Discussions => General Visio => Topic started by: nayone on June 03, 2008, 08:52:46 AM

Title: inserting a new page
Post by: nayone on June 03, 2008, 08:52:46 AM
Hi there

All I want to do is to create a template file for flow mapping so I have made a page but every time I insert a new page & copy the content of the 1st page over I lose all my setting on the layers.

what I mean -
I have a number of buttons whose function is to hide or show the layers and in the shape sheet I have the following code to do this
under actions> Action.row_1 as action>
=SETF(GetRef(ThePage!Layers.Visible[4]),NOT(ThePage!Layers.Visible[4]))
& Menu >
=IF(ThePage!Layers.Visible[4],"Hide Level One","Show Level One")

this gets reset to
=SETF(REF(),NOT(REF()))
&
=IF(REF(),"Hide Level One","Show Level One")

The smart tags seem to stay ok but also the order of the layers under > format > layer
also seem to change

any pointers as I can go in and manually change each one but think there should be something a bit smarter

thx

Alex
Title: Re: inserting a new page
Post by: Lars-Erik on June 03, 2008, 08:55:49 AM
If i recall, we had another problem similar to this.
Try different ways of copying, control + C copying and dragging holding shift give different results.
Title: Re: inserting a new page
Post by: nayone on June 03, 2008, 09:47:50 AM
yup was using ctrl a - ctrl c - ctrl v

tried the menu to do the same with the same results

least its consistantly wrong I suppose  :D
Title: Re: inserting a new page
Post by: Lars-Erik on June 03, 2008, 10:00:07 AM
Try giving the cells:

=Guard( Your formula )

See if that makes them hold there value

- Lars
Title: Re: inserting a new page
Post by: Visio Guy on June 03, 2008, 01:38:47 PM
I don't think that the order of layers isn't guaranteed on copy-paste. Your formulas refer to the layers by index (ie: '[4]'), and these will be off if the order of your layers changes.

I wonder if you assigned a dummy shape to all the layers on one page (in a certain order even?) then copied that shape to a new page first, if it would help?
Title: Re: inserting a new page
Post by: nayone on June 03, 2008, 04:19:56 PM
tried to guard it & that didn't work

also tried your suggestion of making sure that there were correctly referenced layers to copy over & still comes out jumbled

can you refer in layer name rather than order.?
Title: Re: inserting a new page
Post by: Visio Guy on June 03, 2008, 09:24:05 PM
Hi nayone,

You can shield the references inside of quote marks, so they won't get REF'd when you copy and paste. It looks like this:

= SETF("ThePage!Layers.Visible",NOT("ThePage!Layers.Visible"))
= SETF("ThePage!Layers.Visible[2]",NOT("ThePage!Layers.Visible[2]"))

You'll notice that the GETREF is gone, and the cell reference is inside of quotes. Visio first tries to evaluate strings as something it understands (ie: numbers, formulas, etc.) If it doesn't understand, then it just leaves it as a string. You can use this to your advantage in this case.

Note: if your layers get re-created in a different order, your formulas will toggle the wrong layers.