Start Macro on Visio Start

Started by Jumpy, December 10, 2009, 07:18:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jumpy

Hello all,

there's an entry called "Start" at Extras->Options->More Options->Button "File Paths".
visguy: Tools > Options > Advanced > File Paths... > Start-up

(I have german Visio and only translatetd above locations. The real english name may be different).

The help says, that in this path you could save Macros and Add-Ons that will start automatic when Visio is started.

Has anyone tried this? How do I save Makros there? I tried to export a Modul to a *.bas file and saved it there, but nothing happened.

I need this Info (related to another topic, where no answers came) to force Visio to start only with a certain template.

Visio Guy

Hi Jumpy,

I couldn't get vba inside of Visio files to work, nor VBS files. But .exes work just fine.

For example, you can put a copy of the Visio Event Monitor Tool in your "Vis Startup" directory, and it will fire when Visio starts.

I'm sure if you can get COM add-ins to go off using this structure, or if that is even necessary. I find that a lot of the utilities I create work better as .exes anyway. No VBA code being copied everywhere, and no hassle with setup and publishing that add-ins cause.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Jumpy

As .exe means, I have to write sth. in C++ or #???

I just started learning plain C in school.

Or is it possible to save a VBA as .exe, too? With Visual Studio perhaps?

Visio Guy

I make .exes in Visual Studio using C# or VB.NET.

Hmm, maybe I should write another article - simple example of programming Visio using Visual Studio. There are plenty of examples in the Visio SDK, but sometimes people need a story on how to get started.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

wapperdude

#4
Go for it!  Your "stories" are great.   ;D  Besides, unless an individual is "hunting" or "on-a-mission", some aspects of Visio don't "suggest themselves" nor their usefulness.   :P  ???  That's where your "Tales of Visio" come in.  They bring you in, and then, the light goes on.   :o
Visio 2019 Pro

Jumpy

I would like that, too. To see one time how it is done and why.
After that it is easier to use that for other situations, because I hopefully have understood how it works.

Yacine

Hi Jumpy,
I wonder what solution you chose at the end. I do need myself to solve exactly the same problem. Would appreciate if you share it.

Chris, did you happen to write that article yet?
Yacine

Jumpy

Hi Yacine,

I made a empty drawing. Called it "Start.vsd".

It's in a folder that is know to Visio in the Dialog

Tools > Options > Advanced > File Paths > Drawings

I created a new Desktop-Link to Visio, went to properties and entered the filename behind the execute statement.

Know, whenever you start Visio with that Desktop-Link, it will start with that drawing.

-------

That special Start.vsd drawing is mostly empty and contains only one macro for the Document_Opened event in the ThisDocumet modul.
The code there opens the template (does some things to it) and closes the Start.vsd file and so itself.

--------

Not very nice, but it works.