Iterating Through Sections and Rows in Visio ShapeSheets

Just as we have seen in Listing 17.6, using CellsSRC can make locating a particular cell easier if you are not sure exactly where that cell is. Remember that the Shape object also has the SectionExists, RowExists, CellExists, and CellsSRCExists properties to assist you in determining the validity of a particular Cell object.

A Shape object also has the RowCount and RowsCellsCount properties to set limits for iteration. The following sample code fragment iterates through the Geometry1 section of a SmartShape symbol's ShapeSheet and lists each Cell object's formula in the VBS Immediate or Debug window.

 iGeometry = visSectionFirstComponent nRows = shpObj.RowCount(iGeometry) For iRow = 0 To ...

Get Professional Development with Visio® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.