5

The Visio Page object's SetFormulas and GetResults methods requires an array containing ShapeID,Section,Row,Column, in order to batch read/write from/to the shapesheet.

However, I find that in drawings with a lot of shapes, after adding and deleting shapes, Visio's shape ID's cross over the short integer limit of 32768. It seems Visio keeps a short integer ID property on shapes called ID16, but passing the ID16 into that ShapeID,Section,Row,Column array does not seem to work, and raises an 'Unexpected End of File' error.

Is it possible somehow to use the SetFormulas and GetResults methods on drawings where shape ID's have crossed over the short integer limit? Or is there a way to 'restack' shape ID's in a drawing such that, as long as there are less than 32768 shapes in the page, then all the ID's will be below the limit? I know that copying all the shapes into a new drawing will buy some time, but the issue could quickly recur after adding/removing shapes from the page, which my software does a lot of.

The only other alternative I can think of is to capture cases where the shape ID has exceeded the short integer limit, and revert to routines that do operations cell by cell and shape by shape, rather than in a single batch.

Jon Fournier
  • 4,299
  • 3
  • 33
  • 43

1 Answers1

0

I fear there is no solution for this, Microsoft needs to create Int32 versions of SetResults/GetResults/SetFormulas/Getformulas/DropMany.

As PC's have become a lot faster these days it becomes easier to create huge Visio diagrams.

Rerendering a diagram to a new page does help to win you some time, but a 16 bits Shape ID (really a 15 bit limitation) is kind of silly in 2021!