Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article will show you how to use shortcut menus in the Access run-time environment.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 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

9 Experts available now in Live!

Get 1:1 Help Now