Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default SendKeys {Enter} acts like Return rather than Enter


I'm trying to automate QMF from Excel (to automate the
process of exporting a QMF query as an Excel file). This
involves selecting the QMF application and using Sendkeys
to send all the relevant keystrokes. The only problem is
when I try:

Sendkeys "TRAN", True
Sendkeys "{Enter}", True

TRAN appears onscreen but then Enter isn't pressed. It
appears that Return is pressed since the cursor moves to
the beginning of the line as when you press Return in
QMF. Given that Enter and Return have the same effect in
Excel is there another way I need to refer to Enter to get
this command to work in another application?

Many thanks for any help.

Rob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SendKeys {Enter} acts like Return rather than Enter

Sendkeys "~", True

might work.

Regards,
Tom Ogilvy

"Robert Chapman" wrote in message
...

I'm trying to automate QMF from Excel (to automate the
process of exporting a QMF query as an Excel file). This
involves selecting the QMF application and using Sendkeys
to send all the relevant keystrokes. The only problem is
when I try:

Sendkeys "TRAN", True
Sendkeys "{Enter}", True

TRAN appears onscreen but then Enter isn't pressed. It
appears that Return is pressed since the cursor moves to
the beginning of the line as when you press Return in
QMF. Given that Enter and Return have the same effect in
Excel is there another way I need to refer to Enter to get
this command to work in another application?

Many thanks for any help.

Rob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default SendKeys {Enter} acts like Return rather than Enter


-----Original Message-----
Sendkeys "~", True

might work.

Regards,
Tom Ogilvy


Thanks for the idea Tom but it doesn't seem to change
anything. Could it be something to do with some kind of
application settings in Excel or QMF that makes Enter act
differently? Or is SendKeys pretty uniform over
applications?

Thx,

Rob
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SendKeys {Enter} acts like Return rather than Enter

I guess I am missing the distinction between Return and Enter. On my
keyboard, I have no return key. On older keyboards, I believe the enter key
may have been called Return. I have always thought of them as synonymous.

QMF is a mainframe product isn't it - IBM 3270 type stuff. Perhaps it has
to do with your keyboard emulation.

Regards,
Tom Ogilvy


"Robert Chapman" wrote in message
...

-----Original Message-----
Sendkeys "~", True

might work.

Regards,
Tom Ogilvy


Thanks for the idea Tom but it doesn't seem to change
anything. Could it be something to do with some kind of
application settings in Excel or QMF that makes Enter act
differently? Or is SendKeys pretty uniform over
applications?

Thx,

Rob



  #5   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default SendKeys {Enter} acts like Return rather than Enter

Hi Robert,
What happens if you type TRAN and press enter in QMF?

If this is like a VBA userform textbox.
Then does the ENTER event in the textbox do something, or do you need to set
the focus on a button to create an event that starts the processing?

--

John

johnf202 at hotmail dot com


"Robert Chapman" wrote in message
...

I'm trying to automate QMF from Excel (to automate the
process of exporting a QMF query as an Excel file). This
involves selecting the QMF application and using Sendkeys
to send all the relevant keystrokes. The only problem is
when I try:

Sendkeys "TRAN", True
Sendkeys "{Enter}", True

TRAN appears onscreen but then Enter isn't pressed. It
appears that Return is pressed since the cursor moves to
the beginning of the line as when you press Return in
QMF. Given that Enter and Return have the same effect in
Excel is there another way I need to refer to Enter to get
this command to work in another application?

Many thanks for any help.

Rob





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SendKeys {Enter} acts like Return rather than Enter

In application.sendkeys rather than sendkeys you can specify the
difference:

ENTER (numeric keypad) {ENTER}
ENTER ~ (tilde)



Go to the VBE, in a module, type
application.sendkeys

highlight the complete phrase and hit F1.

I guess you would want
Application.Sendkeys "{ENTER}",True

Regards,
Tom Ogilvy


"Robert Chapman" wrote in message
...

-----Original Message-----
I guess I am missing the distinction between Return and

Enter. On my
keyboard, I have no return key.


Most keyboards have return on the right of the main
keyboard area, to the above left of the cursor keys. The
Enter key is the key at the extreme bottom right, to the
right of the number keypad.

On older keyboards, I believe the enter key
may have been called Return. I have always thought of

them as synonymous.

There is a small difference. Enter always acts like
return but enter often does something more than return and
in some programs, particularly primitive ones, you have to
use the enter key *instead* of return.

QMF is a mainframe product isn't it - IBM 3270 type

stuff. Perhaps it has
to do with your keyboard emulation.


Maybe but no-one in IT here seems to know unfortunately.

Rob



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SendKeys {Enter} acts like Return rather than Enter

just to qualify - at least looking at the help for each would lead one to
believe what is sent is different in application.Sendkeys. I don't have a
way to test the difference - but you can try it and see if it makes a
difference.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
In application.sendkeys rather than sendkeys you can specify the
difference:

ENTER (numeric keypad) {ENTER}
ENTER ~ (tilde)



Go to the VBE, in a module, type
application.sendkeys

highlight the complete phrase and hit F1.

I guess you would want
Application.Sendkeys "{ENTER}",True

Regards,
Tom Ogilvy


"Robert Chapman" wrote in message
...

-----Original Message-----
I guess I am missing the distinction between Return and

Enter. On my
keyboard, I have no return key.


Most keyboards have return on the right of the main
keyboard area, to the above left of the cursor keys. The
Enter key is the key at the extreme bottom right, to the
right of the number keypad.

On older keyboards, I believe the enter key
may have been called Return. I have always thought of

them as synonymous.

There is a small difference. Enter always acts like
return but enter often does something more than return and
in some programs, particularly primitive ones, you have to
use the enter key *instead* of return.

QMF is a mainframe product isn't it - IBM 3270 type

stuff. Perhaps it has
to do with your keyboard emulation.


Maybe but no-one in IT here seems to know unfortunately.

Rob





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
Enter multiple numbers in a cell so total shows when enter keypres newbie Excel Worksheet Functions 2 August 19th 07 12:23 PM
Enter info in one sheet, auto enter in another based on one field The BusyHighLighter[_2_] New Users to Excel 1 August 1st 07 10:54 PM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
how do I enter a RETURN (Enter) in a cell in EXCEL2003 Micheline Excel Discussion (Misc queries) 5 April 14th 05 10:00 PM


All times are GMT +1. The time now is 05:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"