Solved

MS Visio 2010 - VBA command syntex used to run a macro from a visio button

Posted on 2014-04-24
3
2,364 Views
Last Modified: 2014-04-25
I am trying to run a macro that I have developed in Visio from a button that I have placed on a Visio page.  However, I cannot determine how to run the macro when the user clicks the button.

I am looking for the syntex to use to initiate the macro when the button is clicked or how to assign a macro to run from a button on the page.

Any Assistaance would be appreciated

Ldufresne
0
Comment
Question by:Lou Dufresne
3 Comments
 
LVL 30

Accepted Solution

by:
Scott Helmers earned 250 total points
ID: 40021797
Running the code with a double-click is easier than with a single click because it doesn't require any programming. If you can live with a double-click, select the button, then on the Developer tab, in the Shape Design group, click the Behavior button. Then click the Double-Click tab, click the radio button for Run macro and select the name of your macro from the dropdown list.

To enable single-click actions, take a look at this question as a starting point.
0
 
LVL 11

Assisted Solution

by:Visio_Guy
Visio_Guy earned 250 total points
ID: 40022262
Hi LD,

If you have placed an "ActiveX button" on a page (i.e. a "real" button, like what you would do in VBA), then try this:

1. Right-click the button
2. Choose CommandButton Object > View Code
3. This will take you to the VBA editor, in a procedure with a name like "Private Sub CommandButton1_Click"
4. If your code is in fact in the VBA, then you can call your code from this procedure. An example might be: Call MMyMacros.DoStuff()

Cheers!
0
 
LVL 1

Author Closing Comment

by:Lou Dufresne
ID: 40023054
Thanks both of you. These answers both address what I need to do. You both have just increased my ability in the coding and macros in Visio. I is a little different syntax than MS Access VB Coding.

I appreciate you assistance

Thanks
Ldufresne19
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question