Solved

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

Posted on 2014-04-24
3
2,288 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mac-based software for Excel 8 39
TSQL DateADD update Question 4 30
Process mapping 5 28
Input Data Using a unique ID from another sheet in Excel 3 17
As freelancing is becoming more and more common in the tech industry, certain obstacles are proving to be a challenge to those who are used to more traditional, structured employment. This article is meant to help identify such obstacles and offer a…
This article will show you how to use shortcut menus in the Access run-time environment.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now