tags:

views:

100

answers:

2

The situation is the following:

Macro Foo is defined in File foo.vss Macro Bar is defined in File bar.vsd.

Bar() is at some point supposed to call Foo(). Is that possible?

If it helps:
foo.vss is a stencil file that is opened in bar.vsd.

FYI:
They are forcing me to use Visio/vba. Its a strange old System that generates SQL from the diagrams, really ugly.

A: 

Never worked with visio before, but a quick browse got me these for excel vba; I'm not sure if it'll work for you, but try it out:

http://www.vbaexpress.com/kb/getarticle.php?kb_id=279
http://www.xtremevbtalk.com/showthread.php?t=139135

JakeTheSnake
+1  A: 

This is possible, using the ExecuteLine method on the document containing the code.

So in your example it would be something like:

Visio.Documents("Foo.vss").ExecuteLine "Foo"

I've used this quite a bit for calling Visio macros from Excel and it's worked quite nicely. ExecuteLine seems like it will execute pretty much anything you can execute from the Immediate Window, so you actually are passing in a line of valid VBA code...

Hope that helps

Jon Fournier