Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default SendKey Question

In case anyone is interested in the answer I figured it out. In microsoft
excel's help
on sendkeys you'll see the following code:

Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator

Make sure caculator is running, comment the second line "RetrunValue..." and
replace the third with AppActivate "Calculator".

Right in front of my face......!!!!!!!!!

"Matt" wrote:

Hi All,

I would like to send key strokes from excel to an application that is
already open (I don't want to open a new instance of it, as shown is Sendkey
example of the calculator). How do I get focus to the application?

Any help would be appreciated.
Thanks,
Matt

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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
sendkey help needed Ryk Excel Discussion (Misc queries) 4 November 6th 06 04:50 AM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
using sendkey to enter vbe password in Excel 2000 jaf Excel Programming 0 September 30th 03 05:53 PM


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

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

About Us

"It's about Microsoft Excel"