Hi Aju,

This is a curious request. It sounds like perhaps you are "asking the wrong
question" :) -- The purpose of an event is to start execution of VBA code
when a certain triggering event occurs, such as a user action, calculation,
opening of a file, etc.  You are asking if you can emulate a user action
(from VBA code) in order to execute the VBA code you now have assoicated
with an event.  Although it is possible to emulate mouse clicks, it's not
possible using just VBA code.  You would I believe have to call out to the
Windows API to do it that way.

 

There is no need to do that.

You can execute other VBA code directly from the procedure that you propose
to trigger that event.

 

If your event is something like this:

SUB something_doubleclick()

    ' do something

END SUB

 

and your other code you envision is this:

SUB othercode()

    ' want to double click "something" here :[

END SUB

 

Do this to have the same effect ~

In a module create a procedure to do the thing you want to happen in your
doubleclick event:

SUB do_something()

    ' do something here

END SUB

 

then, in your doubleclick event call that routine:

SUB something_doubleclick()

    do_something ' this calls the other procedure

END SUB

 

and also call the same routine from your other code:

SUB othercode()

    do_something ' this calls the other procedure =]

END SUB

 

Hope this helps solve your query.

Asa

 

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Aju Chacko
Sent: Tuesday, December 13, 2011 10:25 PM
To: excel macro forum
Subject: $$Excel-Macros$$ How to create a double click using VBA CODE
without actually double clicking on the mouse

 

Dear experts,

                    Kindly help me with vba code for the following problem
,I have created a macro that trap the event DOUBLE CLICKING of mouse,But i
want to optimize in such a way that the user need not double click each time
with the mouse,Instead I want to create double click of mouse using VBA
CODE,so when this code create double click event ,the code written for this
event will get fired.

 

                                                                Thanking you
in advance

 
Aju V Chacko

 

             

-- 
FORUM RULES (934+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to [email protected]

-- 
FORUM RULES (934+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to [email protected]

Reply via email to