Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a button to run Macro

Status
Not open for further replies.

vidamj

IS-IT--Management
Apr 27, 2005
13
0
0
US
I figured out the process to create a button and use it to run a Macro and also display a view. The problem I am having is when I click on the button it cannot find the Macro I created. Suggestions are displayed stating to make sure its in the global organizer, make sure the project is open that the macro resides in etc. The macro is in the project in which I have the button. Any suggestions/solutions welcome. Thanks.
 
Open project and start VBA

In Global.MPT insert a new module and put your code in that module.

Back in Project RightMouseButton on a blank toolbar space and click on Customize...

In the popup:
1. On the Toolbar tab create a new toolbar or select an existing one.
2a. On the Commands tab, under Categories, click on All Macros.
2b. On the Commands tab, under Commands, drag the macro you want to the toolbar you selected in step 1.
2c. On the Commands tab you should see a button called "Modify Selection" ... make any changes you want.
3. Click OK to close the popup

Depending on your environment you may have to:

4. Click Tools | Organizer to move the toolbar and the module from your project to Global.mpt (or, perhaps, it's the other way round).

5. Save the project and update Global.mpt

The next time you open the project you should see the toolbar and the button.

I think I've got the steps right. Play around a bit and see what happens.

(BTW, you don't have to doublepost. Most people providing answers here read all threads flagged with a "new message" icon.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top