How to make a Macro in Microsoft Visio?

Here’s a question from Danny:

I have recently started using Microsoft Visio to make use of diagrams, layouts, and charts. I understood that i can improve my productivity by automating much of the common work across different diagram / drawing files by using Office Macros. As i am pretty new to VBA development, i would appreciate some pointers on how to get started with macros?

Thanks for your question. In this quick post will learn how to setup a simple Macro in Microsoft Visio. This works on versions 2019, 2016 and 2013.

Setup the developer tab in Visio

By default, the developer tab, which has all the required Visual Basic Macro related functionalities comes disabled. Here are a simple steps to enable the developer tab so you can start to create your Visio Macro.

  • On your PC, go ahead and open your Microsoft Visio application, click on File and select Options.
  • Click on Customize Ribbon, and on the right pane, you can see Developer is unchecked.
  • Next, go ahead and check the Developer entry then and hit the OK button to enable the developer tab.

Create a Visio Macro

  • To create a sample Macro, open Visio, click on the Developer tab and select Record Macro.
  • Enter the Macro nameshortcut key, and store the macro accordingly.
  • Click OK to begin the recording, perform the procedure to set the macro.
  • If needed, we can pause the Recording.
  • To stop your recording, hit Stop Recording.
  • To test the Macro, select Macros under the developer tab.
  • Select your macro and hit Run.