Introduction to the ShapeSheet
The ShapeSheet is probably the most overlooked part of Visio. The amount of power that you can get by using the ShapeSheet without any programming is pretty amazing. The basic idea is that behind every shape in Visio there is a spreadsheet that defines the shape in terms of its appearance and many other shape characteristics like data, connection points, and events/actions. There is an introduction to the ShapeSheet in the Developing Visio Solutions book and more comprehensive documentation is available in Visio help. Another good place for information on this topic is in the microsoft.public.visio.developer.shapesheet newsgroup.
The ShapeSheet is very similar to a normal spreadsheet like Excel. It is made up primarily of cells and formulas. The formulas perform mathematical and other operations and can refer to other cells. In turn, the results of these formulas drive the shape properties.
To get to the ShapeSheet for any shape, select the shape and go to "Window>Show ShapeSheet." The ShapeSheet window looks like this:
A couple key points about what you see:
- One of the key differences between the ShapeSheet and a regular spreadsheet is that the ShapeSheet is more structured -- most cells have specific purposes so that values calculated for that cell drives a particular shape characteristic. For example, the cells in the Shape Transform section contains basic information about the shape width/height, location (PinX and PinY), rotation, etc.
- Cells are colored blue or black. Black cells inherit their values from the original master (i.e. shape in the stencil) that they were created from, while blue cells have been locally overridden for this particular shape instance. In the above example, the only cells that have been overridden are the PinX and PinY cells. If the master is changed those changes will propagate to all the individual shapes based on that master, unless the changes are to overridden cells.
- Note that some cells (e.g. width) have units like mm or inches associated with them. These units are meaningful.
One of the best ways to learn about what is possible with the ShapeSheet is to take a look at some of the shapes that ship with Visio. Some intersting ones include "Flowchart shapes" and "Auto-height box" from the Basic Flowchart Shapes stencil, the Rack Diagram shapes, and the Marketing Charts and Diagrams. Drop these shapes out on the page and then view the ShapeSheet.
For the next post, I'll walk through the process of creating a shape from scratch and using the ShapeSheet to give it some interesting characteristics.
Comments
Anonymous
January 02, 2007
This post was extremely useful to me. I was very lost, and this post explained a lot. I am working with changing Cell properties programatically (VBA script), and I am still puzzled on how you have to initialize user defined properties if you want to use them. Simply saying objShape.Cell("User.visUserProp.Value") does not do the trick. Any ideas?Anonymous
April 20, 2007
The comment has been removed