Author Topic: How to add Macros/VBA code as default in Visio 2013?  (Read 1292 times)

0 Members and 1 Guest are viewing this topic.

Venkatesh

  • Newbie
  • *
  • Posts: 7
How to add Macros/VBA code as default in Visio 2013?
« on: November 28, 2013, 10:16:23 AM »
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

Get Visio Guy's new book!


Jumpy

  • Hero Member
  • *****
  • Posts: 1055
Re: How to add Macros/VBA code as default in Visio 2013?
« Reply #1 on: November 28, 2013, 11:43:07 AM »
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.

Visit the Visio Guy web site at www.visguy.com for hundreds more articles on Visio!


Venkatesh

  • Newbie
  • *
  • Posts: 7
Re: How to add Macros/VBA code as default in Visio 2013?
« Reply #2 on: November 28, 2013, 12: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.....?? :-\

Jumpy

  • Hero Member
  • *****
  • Posts: 1055
Re: How to add Macros/VBA code as default in Visio 2013?
« Reply #3 on: November 29, 2013, 04: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.


Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2074
    • Sandrila Ltd
Re: How to add Macros/VBA code as default in Visio 2013?
« Reply #4 on: November 29, 2013, 05: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/, use the menu
SuperUtils -> Stencil -> Manage startup stencils
and add this stencil to your startup list.

Engineering, business and software stencils and applications for Visio - http://www.sandrila.co.uk/
Twitter: http://twitter.com/sandrilaLtd

Venkatesh

  • Newbie
  • *
  • Posts: 7
Re: How to add Macros/VBA code as default in Visio 2013?
« Reply #5 on: November 30, 2013, 05:18:11 AM »
@Jumpy: Can u please explain me with detailed steps..??


Venkatesh

  • Newbie
  • *
  • Posts: 7
Re: How to add Macros/VBA code as default in Visio 2013?
« Reply #6 on: December 03, 2013, 09:00:38 AM »
@Paul Herber :

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