Using VBA to set shape's Comment

D

Dan

I am creating shapes in Visio 2002 using Excel VBA and
want to set the "Comment" cell so that the text will show
up when a user hovers over the shape. On the shape sheet
in Visio, I can enter text, but via VBA, I get a "type
mismatch" error. The debugger indicates that
the "Comment" cell is numeric with a value of "0". The
VBA line that I am using (unsuccessfully) is:
Shape1.Cells("Comment") = Description

How can a cell be numeric when accessed via VBA, but be a
text field when viewed interactivly via the shape sheet?
 
D

David Parker

If you have a variable Description, the you need to insert text like this:

shp.Cells("Comment").Formula = "=""" & Description & """"
 

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