making macros more available

Started by dtallent, March 24, 2017, 03:46:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dtallent

I am using a macro while working on a blueprint. Is there a way to save this macro so that I can use it on another blueprint without having to create an entirely new macro for every blueprint?

Surrogate


wapperdude

Begging the question that Surrogate raised, rather, assuming your just talking about macros that you wrote for a Visio file that your working on, and now want them to be more universally available.  There are a variety of ways:

1.) After you have working macros you can go to the VBA window and do either:
      a) select each macro individual, go to File > Export.  Pick a directory to place the file, give it a name and save.  Do for each macro.
     b) in the project drawing window (show tree structure), select, e.g., ThisDocument, and do export.  This will export all of the macros at once. 
     c) to retrieve the macro(s), do import.  Note, these are typically .cls files.  Method a lets you chose individual macros; method b you get all of them.

2.)  Add the macros to the stencil containing your shapes.  The macros will travel with the stencil.

3)  Save your file as a template.  All of your settings will load up.

That's it in a nutshell.

Wapperdude
Visio 2019 Pro