We want to hear from you - setting cells programmatically

M

Mark Nelson [MS]

The Visio team would like to hear from developers who programmatically set
formulas and values in the Shapesheet. The basic way to change a Shapesheet
cell is with Cell.Result() or Cell.Formula(). There are also ways to change
cells in bulk.

Did you know that calls to Cell.Result or Cell.Formula can fail? Do you
know that Visio will throw an exception if the cell has a GUARD expression
in it?

We want to hear from you. Are you aware of this failure possibility? Do
you currently wrap your calls with error handling to prevent a crash in your
code? What do you do in your error handler (e.g. nothing / skip the cell,
show error message, try again with FormulaForce)?

Visio shapes are getting more sophisticated in behavior, and the GUARD
function is frequently used to prevent changes to the cells that provide
that behavior. However, your code has to trap exceptions in order to
interact with these shapes properly.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Al Edlund

Mark,
I have a 'library' class of common visio calls that I use where I have
wrapped almost all of the functions/subs with the enterprise library
exception manager. It has proven to be a life saver when doing development
with vs2005.
al
 
V

vojo

I steer clear of VBA and such due to all the security issues. It would be
nice to have some sort of java or C library to interface into the shapesheet.
Frankly, if there was a nice way for one shape to reference another
dynamically (index key to look up shape to go after)....or...a nice way to
interface to a excell spreadsheet cell...I would be 100% set in my usage.

FYI...I have managed to do multiple drop downs, "light source" orientation,
shape "insertion/placement", etc all strictly thru shapesheet. So while I
dont profess to be as fluent as you guys at this...I am pretty set.
 
M

Markus Breugst

Hi Mark,

yes, we are aware of failures caused by the GUARD function. To avoid them,
we use FormulaForce. In some cases our application itself uses the GUARD
function to protect cells from being modified by the user.

In order to handle other exceptions and to facilitate the access to the
Visio object model for our special needs, we also (as Al Edlund) have
implemented wrapper classes around the Visio library.


Best regards,
Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top