Solved

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

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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

690 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