I get a type mismatch error when I access my custom property cells

J

Jason V

I have a custom property called Prop.Label. When I use the following code
vsoShape1.Cells("Prop.Label.Value") = 3 then my field with that property
changes to 3. However if I want the label to be Q3 I try
vsoShape1.Cells("Prop.Label.Value") = "Q3" , here I get a type mis match
error, err 13.

I have the type in the custom property = 0 which is for visPropTypeString.

Any help please?
 
J

JuneTheSecond

Rewrite "Q3" as """Q3""", because text data in a cell must be quoted like
"Q3", and so, a formula must be double quoted.
 
A

Al Edlund

there's a couple of routines in the sdk that will perform that wrapping for
you that JuneTheSecond described.
al
 
J

Jason V

Thanks for the input. Two questions, what I am really trying to do is use a
variable,
such as , VariableName = a value in from an excel cell say Q3. Now I want
that value to be in my shape using vsoShape1.Cells("Prop.Label.Value") =
VariableName.
If the cell in excel = 3 it works but if it is Q3 I get the type error.
2nd question to Al, what is the sdk?

Thanks

--
Jason V


Al Edlund said:
there's a couple of routines in the sdk that will perform that wrapping for
you that JuneTheSecond described.
al
 
D

David Parker

Al's answer holds true.
Numeric values are entered without quotes, but strings need to be
double-quoted
The SDK is the Software Developer Kit for Visio 2003 or 2007 - a free
download from Microsoft.

Jason V said:
Thanks for the input. Two questions, what I am really trying to do is use
a
variable,
such as , VariableName = a value in from an excel cell say Q3. Now I want
that value to be in my shape using vsoShape1.Cells("Prop.Label.Value") =
VariableName.
If the cell in excel = 3 it works but if it is Q3 I get the type error.
2nd question to Al, what is the sdk?

Thanks
 

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