Rightclicking with 'sendkeys'

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can this be done?

I need to populate a database (Oracle based) with data from Excel but to get
data into this database it involves rightclicking the column heading followed
by tab keys to enter data. I have checked to see if the 'right click' key on
the keyboard works -it doesn't - nor can any other key on the keyboard
replicate a right mouse click.

I know I can use sendkeys for the tabs but is there a sendkeys statement to
produce the equivalent of this right clicking of the column heading?
 
Right clicking on the column header does 2 things: it selects the column and
it opens the column context menu. Is that what you want to do via SendKeys?

Sub a()
SendKeys "^ "
SendKeys "+{F10}"
End Sub

or

Sub aa()
SendKeys "^ +{F10}"
End Sub


--
Jim
| Can this be done?
|
| I need to populate a database (Oracle based) with data from Excel but to
get
| data into this database it involves rightclicking the column heading
followed
| by tab keys to enter data. I have checked to see if the 'right click' key
on
| the keyboard works -it doesn't - nor can any other key on the keyboard
| replicate a right mouse click.
|
| I know I can use sendkeys for the tabs but is there a sendkeys statement
to
| produce the equivalent of this right clicking of the column heading?
 
Jim,

Yes, I do want to select the column and open the column context menu.

I tried copying/pasting both versions of your code and ran the macro but it
didn't appear to do anything?

Where could it be going wrong? Or if it won't work is there alternative
code to Sendkeys to do this?

Tony
 
Jim,

Correction to my last reply. The context menu by simulating a right click
in a column CELL with the code you gave me is a copy/delete etc list. The
window that opens when the column HEADER is rightclicked is a dialogue box in
which I want to input data. I hope this makes it clearer!

Kind regards,

Tony
 
The window that opens when the column HEADER is rightclicked is a dialogue
I'm sorry but it doesn't. I don't know what dialog box you're referring to.

--
Jim
| Jim,
|
| Correction to my last reply. The context menu by simulating a right click
| in a column CELL with the code you gave me is a copy/delete etc list. The
| window that opens when the column HEADER is rightclicked is a dialogue box
in
| which I want to input data. I hope this makes it clearer!
|
| Kind regards,
|
| Tony
|
| "Jim Rech" wrote:
|
| > Right clicking on the column header does 2 things: it selects the column
and
| > it opens the column context menu. Is that what you want to do via
SendKeys?
| >
| > Sub a()
| > SendKeys "^ "
| > SendKeys "+{F10}"
| > End Sub
| >
| > or
| >
| > Sub aa()
| > SendKeys "^ +{F10}"
| > End Sub
| >
| >
| > --
| > Jim
| > | > | Can this be done?
| > |
| > | I need to populate a database (Oracle based) with data from Excel but
to
| > get
| > | data into this database it involves rightclicking the column heading
| > followed
| > | by tab keys to enter data. I have checked to see if the 'right click'
key
| > on
| > | the keyboard works -it doesn't - nor can any other key on the keyboard
| > | replicate a right mouse click.
| > |
| > | I know I can use sendkeys for the tabs but is there a sendkeys
statement
| > to
| > | produce the equivalent of this right clicking of the column heading?
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top