patgenn123 Posted November 19, 2009 Report Share Posted November 19, 2009 Is there a way to trigger a macro when I click on a control? The reason I ask such a simple yet idiotic question is because the Activation Tab gives us only two choices: 1)Control on Top 2) Control Focused Well, neither one works. It keeps on triggering the macro when the larger control is visible and I only want the control to be triggered ONLY WHEN I click on a certain button on the larger control. The larger control is a form and the button(which is subcontrol of the larger control(the form) is what I want to trigger the rest of the macro. I have tried different things like the larger control as the trigger, but nothing seems to work. It just triggers it when the control is visible. I don't want that. I want the macro to trigger only when I click the button. This is a dunce question, but certainly would like some help. Thanks all! Pat Quote Link to comment Share on other sites More sharing options...
Yehnfikm8Gq Posted November 26, 2009 Report Share Posted November 26, 2009 There could be two ways of tackling the problem. One is to activate the macro when needed. The other is to have a macro already running and monitoring for a specific mouse click on the button to proceed. Instead of using controls you could alternatively use a mouse event (eg click) in either of these scenarios, with suitable logic to identify that the button area in the correct window has been pressed. A solution will have to take into account what else you are doing with the windows/pc and what effect pressing the button may have. Yet another method would be to have a hotkey that starts the macro, giving a mouse left click on the button followed by the rest of the macro main action. I don't use controls very much so I'll leave that area to someone more experienced. edit: mouse right changed to mouse left Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.