SETF-problem with Visio 2007

Started by stygge, March 01, 2013, 03:41:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stygge

I want to send the function CALLTHIS("Ping",SHB") into the cell EventDblClick from the Actions section. I use the formula SETF(GetRef(EventDblClick),"CALLTHIS(""Ping"",""SHB"")") and it works fine in Visio 2010 but not in 2007. Nothing happens. Any ideas why? If I manually add CALLTHIS("Ping","SHB") to the EventDblClick cell it works fine in 2007. There seems to be a problem with the quotation marks inside the formula in 2007. A formula like SETF(GetRef(EventDblClick),"DOCMD(1312)") works fine.

/Staffan Söderholm

Yacine

You may try to concatenate the string during the processing: "CALLTHIS(" & """ & "Ping" & """& "," & """& "SHB" & """ &")")
Yacine

Surrogate

#2
i think this topic must named "CALLTHIS problem"

i tried use CALLTHIS-function in Visio2003 and 2010, this function don't work !


on my PC in Visio 2010 it work, but you need add "thisdocument." before routine name ! Like as...
Quote=SETF(GetRef(EventDblClick),"CALLTHIS(""thisdocument.test"",,""ololo"")")
=SETF(GetRef(EventDblClick),"CALLTHIS("&""""&"thisdocument.test"&""""&",,"&""""&"SHB"&""""&")")

these two ways are usable on my PC with 2010.

PS: But now work in Visio2003 :(

stygge

Thanks for your input Yacine and Surrogate.

SETF(GetRef(EventDblClick),"CALLTHIS("&""""&"Ping"&""""&","&""""&"SHB"&""""&")") works fine in Visio 2010 but so did SETF(GetRef(EventDblClick),"CALLTHIS(""Ping"",""SHB"")") too. None of them works for me in 2007. Nothing happens at all. There is nothing wrong with the CALLTHIS-function. When I manually put CALLTHIS("Ping","SHB") to the EventDblClick cell it works fine in 2007. "Ping" is a macro put in a stencil called "SHB". Maybe I have to persuade my customer to upgrade Visio.

Surrogate

#4
Right CALLTHIS-function Syntax

from Visio 2002 Developer's Survival Pack (by Graham Wideman)


In your formulae CALLTHIS("Ping",SHB"), i don't see where placed your procedure Ping in ThisDocument Module or NewModule of your stencil SHB.vss

Jumpy

As a Workarround. Couldn't the Action place a True or False in a user defined cell and in the EventDouble cell you write sth. like:
=If(User.MyUser,Callthis(...),"")

vojo

or even used DEPENDSON(action.checked)

Smething like
   user.launch = callthis ("...","...","...") + DEPENDSON (action.checked)
   VBA could decide if action is checked=>non checked....or .....nonchecked=>checked 
    (or maybe 2 sets of actions in VBA...one for when checked and one for not checked)

stygge

Of course Jumpy. Nice and simple solution. Thanks a lot!

I guess I could have done something nice with DEPENDSON as well vojo. Thanks for your idea!

Just a comment to Surrogate too. "Ping" is my procedure and "SHB" is my stencil (or rather my Project in VBA). It seems that I don't have to specify the name of the module. It works fine anyway, maybe because I have only one module.

Jumpy

Quote from: stygge on March 07, 2013, 09:35:55 AM
It seems that I don't have to specify the name of the module. It works fine anyway, maybe because I have only one module.

Or because you have only one procedure with that name...