general question about read from and write to shapesheet's cells

Started by hidden layer, April 04, 2023, 01:36:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hidden layer

Hi,
sometimes I experience a "failure" in the code that causes from inappropriate Read/Write commands and/or Unit - referred to expression.Command(unit).
For me it's hard to tell between the usage of Result (and it's derivates) and Formula.
Complete lost I am with the units. Try and error ist the "safe" harbor to swim around. Something I can figure out in time, something I need a wakeup-moment (next day or so).

Is there an introduction to a general use of these parameters, what to use in which case (or what not)?

some example is: what is the difference between ResultStr("") and Resultstr(visNoCast)
or something about visNone I couldn't find.
M$ give rare information - so if you have some hint to something useful - thanks!

hl

Yacine

I used resultstr("") for a very long time, but it often gave me a "0,0000" where nothing was in the cell.
NoCast seems to be the safer option.

As for the units, this is a very important point, since both the developer and Visio try simultaneously to interpret the unit.
This is especially the case when doing calculations in eg user cells and use them for geometrical matters.
Too often Visio takes the numbers as inches - even when the document is set to metrics.
Helpful in this case is to specify explicitly the unit. Eg prop.rowx & "mm"
Yacine

hidden layer

Quote from: Yacine on April 04, 2023, 01:52:29 PM
Eg prop.rowx & "mm"
You mean a construct like this: tGtK = """" & "Kringl" & """" (with 4 quotes on each side. I checked to use CHR(34) instead but then the sub was left by the program without a message. Using debug.print everywhere gives the hint but this is a bit annoying over time.
;)

Yacine

No, I meant:

user.A = 10
user.B = user.A * 2 & "mm"
width = user.B
Yacine