CALLTHIS in the Prompt of a ShapeData

M

mikeFin

Hello!

I need to put this code in the Prompt-cell of a ShapeData:

=CALLTHIS("module1.procedure",)

My Problem is that I need to do that not through the ShapeSheet, but through
the ShapeDataSets.
I have to do that through ShapeDataSets, otherwise I get some other troubles
having the ShapeData the same everywhere.

But when I put the code above in Prompt-field of the "Define Shape
Data"-Window I get this in the ShapeSheet:

"=CALLTHIS(""module1.procedure"",)"

I triend to put this "=CALLTHIS("module1.procedure",)" but it doesn't work
either.


So how can I put a formula in the Prompt-field of a ShapeData-Window?

Thanks in advance !!!
 
S

SteveM

Hello!

I need to put this code in the Prompt-cell of a ShapeData:

=CALLTHIS("module1.procedure",)

My Problem is that I need to do that not through the ShapeSheet, but through
the ShapeDataSets.
I have to do that through ShapeDataSets, otherwise I get some other troubles
having the ShapeData the same everywhere.

But when I put the code above in Prompt-field of the "Define Shape
Data"-Window I get this in the ShapeSheet:

"=CALLTHIS(""module1.procedure"",)"

I triend to put this "=CALLTHIS("module1.procedure",)" but it doesn't work
either.

So how can I put a formula in the Prompt-field of a ShapeData-Window?

Thanks in advance !!!

Mike,

It is not really clear what your functional objective is, in other
words apart from placing that code in the prompt box, what sort of
operational outcome are you hoping to realize? If that were clearer,
at least to me perhaps I could offer some advice. Hopefully the some
of the other guys here can chime in given what you've already
provided.

SteveM
 
M

mikeFin

I am not sure what more information are needed or how I could help you to
help me, but I hope that will help:


By putting the code, of course I want to run a VBA-function.

This function changes the line-weight and the line-color of that shape,
dependently from the input of this ShapeData.
For instance if I have "VPN" as value in my ShapeData, the lineColor will be
read, if not, it will be black.
(It works, when I have the code in the ShapeSheet, but not if I put it in
the Prompt-Box of the "Define Shape Data"-Window, because Visio putts some
extra quotes around my formula.)

Some time ago, I tried calling this function by putting something like
CALLHITS("bla.bla",)+DEPENDSON(Prop.ShapeDataName) in an user-defined-cell,
but for some reason it didn't work. I got the DEPENDSON working for other
things I had to do, but not for this. So my only solution was to put that
code in the prompt-box
 
S

SteveM

I am not sure what more information are needed or how I could help you to
help me, but I hope that will help:

By putting the code, of course I want to run a VBA-function.

This function changes the line-weight and the line-color of that shape,
dependently from the input of this ShapeData.
For instance if I have "VPN" as value in my ShapeData, the lineColor will be
read, if not, it will be black.
(It works, when I have the code in the ShapeSheet, but not if I put it in
the Prompt-Box of the "Define Shape Data"-Window, because Visio putts some
extra quotes around my formula.)

Some time ago, I tried calling this function by putting something like
CALLHITS("bla.bla",)+DEPENDSON(Prop.ShapeDataName) in an user-defined-cell,
but for some reason it didn't work. I got the DEPENDSON working for other
things I had to do, but not for this. So my only solution was to put that
code in the prompt-box

Mike,

OK, I think I see. The problem is that even if you had that Call
statement in the prompt box it wouldn't call anything because
subroutines are initiated by Events. That statement would just sit in
the prompt box minding its own business.

But that's not really much of a problem as long is you can isolate the
Event which may result in need to change the formatting of the
connecting lines. So let's say your Shapes are connected to a
database and you've written a routine that refreshes the Shape Data
from the database. So that's the Event and you would follow the
refreshing with a cycling through the Shapes mapped to the database to
check for the value in the Shape Data Field and then use If or Case
statements and update the format of the associated connecting lines.
So some pseudocode like this:

Sub RefreshShapes
Dim vShape as Shape
Dim dataShapes as Shapes

Call RefreshData

For Each vshape in dataShapes
If vShape.ShapeValue = "VPN" Then
LinkedLine.Color = "Red"
EndIf
Next

That pseudocode is really crude. You'd have to fill in all the
details. But I hope you get my drift. I'm pretty new to Visio
myself. And it's not totally clear to me the most efficient way to
link up Shape Data in different Shapes. I've been experimenting with
using a common index when assigning shape names via code. So for
example if I have a Shape named S01 then a connecting line may have a
name of L01 so I can easily map one Shape to another in the For Each
section of the code by their common indices. There may be easier
ways. But I just haven't figured them out yet.

Good Luck,

SteveM
 
D

David Parker

Another approach is to use SETF() in the ShapeSheet to change the LineWeight
and LineColor of the Shape according to the selected value in the Shape Data
Value cell. This is more direct and efficient than using VBA.
 
D

dilettante101

Another approach is to use SETF() in the ShapeSheet to change the LineWeight
and LineColor of the Shape according to the selected value in the Shape Data
Value cell. This is more direct and efficient than using VBA.

David,

Thanks! A direct method is great to know. But I am wondering how to
reference external shape data. For example in Mike's case here, the
LineWeight and LineColor values of the connecting line are conditioned
on a Data Value in the Attached 2D Shape. So what is the proper
syntax for making the reference? If you could point us to an example,
that would be great.

SteveM
 

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