ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trying to Send a Keystroke to a specific Window (https://www.excelbanter.com/excel-programming/405412-trying-send-keystroke-specific-window.html)

Jason Zischke

Trying to Send a Keystroke to a specific Window
 
Hi all

I trying to send a keystroke to a specific window the first command goes all
right but it doesn't send the key. Below is my code.

appactivate "Microsoft Excel - My Book.xls"
SendKeys "{ENTER}"

Jason

Chip Pearson

Trying to Send a Keystroke to a specific Window
 
I would very strongly recommend that not use SendKeys, especially with an
application like Excel that supports automation. If you describe what you
need to accomplish, you will likely get a better approach that SendKeys.

--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"Jason Zischke" wrote in message
...
Hi all

I trying to send a keystroke to a specific window the first command goes
all
right but it doesn't send the key. Below is my code.

appactivate "Microsoft Excel - My Book.xls"
SendKeys "{ENTER}"

Jason



Jason Zischke

Trying to Send a Keystroke to a specific Window
 
Hi Chip

What I am trying to accomplish is I have created like a little program which
prints to another excel window that is open so that the user can keep working
while it prints so I tried sending a keystroke to that window where I have
set up an Onkey
accelerator to preform the print function on demand.

Jason

"Chip Pearson" wrote:

I would very strongly recommend that not use SendKeys, especially with an
application like Excel that supports automation. If you describe what you
need to accomplish, you will likely get a better approach that SendKeys.

--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"Jason Zischke" wrote in message
...
Hi all

I trying to send a keystroke to a specific window the first command goes
all
right but it doesn't send the key. Below is my code.

appactivate "Microsoft Excel - My Book.xls"
SendKeys "{ENTER}"

Jason




All times are GMT +1. The time now is 03:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com