Where are Inserted Fields Expressions Stored?

Started by perry59, March 24, 2015, 07:57:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wapperdude

Either we're not on the same page, or something.  I've updated your file to include the code, both versions.  Select the wire shape, then run the code.  You will see that it returns the formula in the character string.  Then, if you want the literal formula that does the actual work, you need one more step and fetch the contents of that formula, which is this case is a User cell.

It's a two step process. 

I've provided shapesheet snippets to show both the values and formulas in the relevant shapesheet sections.  There is nothing else.

Hope this clarifies what's going in the shapesheet and your wire shape.

Wapperdude
Visio 2019 Pro

perry59

Wow!
now that is weird. the little sub you provided does indeed get the string I am looking for!
but when I paste the appropriate lines into my code, it gets the evaluated string!
there is something else going on here that I am going to have to investigate, just not sure where to look.
Thanks for your patience Wapper, you were right ::)

perry
what, me worry?

Nikolay

Quote from: perry59 on March 25, 2015, 07:10:59 PM
I'm trying to test the field first to see if it needs updating, right now it ALWAYS updates because my testing of the formula is not working.

I'm not quite sure what the problem is, just an observation why your code ALWAYS updates the field - it compares "GUARD(User.GAWireText)" with "User.GAWireText". They are obviously different.
If you remove "GUARD()" in the condition, or add "GUARD()" to formula then it should stop updating. Hope I understand the issue correctly.

perry59

Good catch Nikolay!
True that comparison would NEVER work. Even after fixing it though the comparison fails because the string I am getting with "vsoChars.FieldFormula" is not returning what I expect.
You saw the lengthy discussion between myself and wapperdude, I thought his code did not work until I tried it on its own and found it DID work. For some strange reason, the same lines in my code return something else.
I'll be racking my brain over this during the weekend ???

perry
what, me worry?