Shapesheet error & inscrutable code (Visio 2010 Professional)

Started by MilesT, December 16, 2015, 03:02:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MilesT

Hi,  I recently saved one of my diagrams as .vdx and reopened it (I do this from time to time to have Visio revalidate the shapesheets and remove any corruptions that have built up in the binary .vsd overtime)

It's a document I have inherited and the "document" stencil shows signs of the diagram having been repurposed through several generations of diagrams of varying purposes and edited with various versions of Visio (2003 & 2007 to be sure)

(I really must work out what is really needed and delete what is not needed from the document stencil)

Anyway, on reopening the diagram I got the following error

[Warning] DataType:
Context: <VisioDocument><Masters><Master ID='7' Name='Line-curve connector'> Sheet.5!Actions.Row_2
Description: Visio could not assign the specified formula to the cell and has substituted an alternate formula.
Old formula: IF(AND(Controls.Composes with=Width/2,Controls.Composes with.Y=0),"","_Set As Straight Line")
New formula: ""

So, used the Drawing Explorer window to find the impacted Shapesheet (Line-curve connector in the Master).  Although the error message does not say this, the offending formula was in the Menu column of the Actions Section (Row_2). Found this by comparing the before .vsd and the after .vdx

By comparing the formula to others in the shapesheet I added some quotes and re-instated the formula in the Menu column:
=IF(AND("Controls.Composes with"=Width/2,"Controls.Composes with".Y=0),""," Set As Straight Line")

And this seems to work..menu option restored on the right click on the shape, roundtrips through vdx successfully.

But I cannot figure out what the formula is trying to do and therefore WHY this works, if it works properly (have I put the quotes in the right/optimal place?). 

The shape is not in use on the diagram, so this is not critical.

Have tried lots of Google and reading of the manuals on MS website to understand the Compose phrase

There is a similar shape in the "Basic Shapes (Metric)" stencil (Visio 2010 version), which has this formula instead
=IF(AND(Controls.Row_1=Width/2,Controls.Row_1.Y=0),"","_Set As Straight &Line")

Which is more in line with the documentation, although I don't understand what Controls.Row_1 would evaluate to or why, looking at the Shapesheet row and the docs.

No relevant Macros in the sheet (although there are macros in the sheet, and there may have been others since deleted)

Any explanations greatly welcomed, as this would help my understanding of shapesheets.

Visio 2010 Pro, no SP (14.0.4760.1000 32 bit).  No compatibility pack
Stencils: Basic Shapes (Metric), Blocks (Metric), Conceptual Web Site Shapes (Metric), and a load of stuff in the document stencil (not much actually used)

jw76novice

You can rename the rows in the Controls section of the ShapeSheet.  By default, they are called "Row_1", "Row_2", etc. but if you double-click the Controls.Row_1 Name cell (that's what I call it - the one with red font at the left side of each row), you can specify a name for each row.

This might explain your "Controls.Composes with" formula, although not completely because you can't have spaces in the name.  Try it and Visio will tell you the allowable characters (at least, in Visio 2013 Professional it does).

Well, this may explain it.  Visio is telling you the formula is invalid, probably because of the space, which isn't allowed.  Your fix of putting double-quotes where you did changes those parts of the formula to a literal string - i.e. AND("String1"=Width/2, "String2".Y=0).  The first expression can probably be evaluated (to FALSE), although "String".Y shouldn't work.  I'm stumped on that one.

HTH
Visio 2013 Professional