Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-04-24
3
Medium Priority
?
2,635 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 31

Accepted Solution

by:
Scott Helmers earned 1000 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 1000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
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 …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

597 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