Visio Guy

Visio Discussions => General Visio => Topic started by: Venkatesh on November 28, 2013, 03:16:23 PM

Title: How to add Macros/VBA code as default in Visio 2013?
Post by: Venkatesh on November 28, 2013, 03:16:23 PM
Hello All,

I have developed a Macro (A VBA code) in Visio 2013 to avoid some repeated work.
But if i try to put this Macro in some other Visio file, i need to add it manually (Copy the VBA code and paste it).

Is there any way to make this Macro/VBA code available on all Visio file by default..? Means, even if i open an New visio file, i need this Macro/VBA code into it as default.

I hope i am clear with my question. Please help me out with detailed steps.

Thanks in advance.
Venkatesh
Title: Re: How to add Macros/VBA code as default in Visio 2013?
Post by: Jumpy on November 28, 2013, 04:43:07 PM
You could place the code in a drawing. Save that as a template. Now the code is available in every new drawing, based on that macro.

As there is in Visio no thing as the Normal.dot in Word, you can't make the macro available for everything.
Title: Re: How to add Macros/VBA code as default in Visio 2013?
Post by: Venkatesh on November 28, 2013, 05:28:16 PM
This method I have tried...But macro will not be available if I open vsd file out of this template, means new visio file..
Is it really not possible to address my concern.....?? :-\
Title: Re: How to add Macros/VBA code as default in Visio 2013?
Post by: Jumpy on November 29, 2013, 09:17:20 AM
I can't imagine why? Code placed in a template should normally be available in all drawings based on that template. (The drawings have naturally to be made after the template is altered in this way). The code is not available in older drawings!

Another thing you could think about: If you use a certain stencil in all of your drawings, you could place the code in the macro modul of the stencil. Now the code is available in every drawing that uses that stencil. The older drawings, too.
Title: Re: How to add Macros/VBA code as default in Visio 2013?
Post by: Paul Herber on November 29, 2013, 10:18:49 AM
I have another way to do this ...
Put your code in a stencil
Using my Super Utilities for Visio http://www.sandrila.co.uk/visio-utilities/ (http://www.sandrila.co.uk/visio-utilities/), use the menu
SuperUtils -> Stencil -> Manage startup stencils
and add this stencil to your startup list.

Title: Re: How to add Macros/VBA code as default in Visio 2013?
Post by: Venkatesh on November 30, 2013, 10:18:11 AM
@Jumpy: Can u please explain me with detailed steps..??
Title: Re: How to add Macros/VBA code as default in Visio 2013?
Post by: Venkatesh on December 03, 2013, 02:00:38 PM
@Paul Herber :

Any other options..? How i can insert an VBA code in stencil..?