Why =RUNADDON("msgbox ""hallo""") in TheText Event Cell doesn't work ?

M

Mosca

Why =RUNADDON("msgbox ""hallo""") in TheText Event Cell doesn't work when I
go to change text of the shape?

Thanks 1000
Mosca
 
C

Chris Roth [ Visio MVP ]

Which version of Visio are you using? "In-line" VBA code in ShapeSheet cells
stopped working in Visio 2002, due to security concerns.

More here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvisio02/html/vis_runadd.asp

From the horse's mouth:

Note The changes made in Visio 2002 prevent the RUNADDON function from
accepting arbitrary VBA code as an argument, or accepting calls to
procedures with arguments.

--

Hope this helps,

Chris Roth
Visio MVP
 
M

Mosca

As you suggest to me I read here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvisio02/html/vis_runadd.asp
but Visio does not recognize procedure and nothing happens.

I done as follows:
1. Created projet named: TestProject
2. Added a shape to Page 1
3. Added to TestProject a module named Module1 (on Visio VBA)
4. Added a function named TestFunction to Module1
5. Added to TestFunction folowing line code: msgbox("Hallo: this is a
test!")
3. Edited EventDblClick field of shape I added (see point 2) as follows:
=CALLTHIS("TestProject.Module1.TestFunction ")

Please tell me where is the mistake and if you could write me an example.

Thanks a lots
Mosca
 
C

Chris Roth [ Visio MVP ]

You may have forgotten a shape variable in your function declaration. This
system works if you double-click the shape:


Shape:

EventDblClick = CALLTHIS("Bob")

Module (not ThisDocument)

Public Sub Bob(shp As Visio.Shape)
MsgBox shp.Name
End Sub


--

Hope this helps,

Chris Roth
Visio MVP
 
M

Mosca

Your suggestion runs well if I add EventDblClick = CALLTHIS("Bob") to the
Master Shape and if the visio document has a module with Nob procedure.

I need that =CALLTHIS("Bob") calls Bob procedure of Master (stencil) Module
..Otherwise everytime a create a new visio document I nedd to ad a module to
it.

How can it be possible?

Thanks
Mosca
 

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