"Quotes" problem

J

John

These quotes (") are driving me up the wall! I know there is so logic to
this but I just can't see it at the moment:

The following works when lstProps.List(i, 1) doesn't contain any " within
the string:

(eg lstProps.List(i, 1) = The book Zorro is old)

NewShpsCol(x).Cells("Prop." & lstProps.List(i, 0)).Formula = "=""" &
lstProps.List(i, 1) & """"

........but when you do get quotes in the string (eg lstProps.List(i, 1) =
The book "Zorro" is old) it falls over.

I thought I'd just add a " at either end, but no joy.

Can someone please explain what the rules are?

Thanks

John
 
A

Al Edlund

I cheat. I use the visio sdk available from msdn when I want to assign
values. You do have to be careful when mixing formula's and values, since
they are different.

al
 
J

John

Hi Al,

What part of the SDK (I can only see the Event monitors, ShapeStudio etc.)
and what do you mean by "use"?

Thanks

John
 
A

Al Edlund

if you check in the library under shapes, you can find an example
"SetCellValueToString". There are other useful routines in the utilities
section for string/formula operations.
al
 
J

John

Thanks very much for this Al. I downloaded the SDK a while ago and then
promptly forgot where it was!

Is there a vba alternative to the SetCellValueToString function? (My trial
version of VS 2003 ran out in June and I've been waiting for November for
2005. Quite why MS didn't call it VS 2006 and just launch early, I don't
understand :) )

Thanks

John
 
A

Al Edlund

the vb code is almost identical to vba and with a little work should be
fine.
al
 
G

googull

John - I use ...& chr(34) & in lieu of the embedded quotes. It works and
is more simple to read.
 

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