Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Cory Nelson   on Feb 15 In MS Office Category.

  
Question Answered By: Harold Graham   on Feb 15

Well, let's keep trying.

If I'm in Word, and I want to send the word "hello" to Excel, I can use:



Sub SendThem

AppActivate "Microsoft Excel"

DoEvents

SendKeys "hello"

End Sub



For me, this brings up Excel and types "hello" wherever I am in Excel,
whether that's in a cell or a dialog box  or whatever happens to be open.



One key here is the DoEvents call -- this allows Windows to actually give
the other app the focus BEFORE doing the SendKeys, otherwise, it just sends
"hello" to my own app (Word).



Does the addition of DoEvents help at all?

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Answering message box with visual basic statement Or get search suggestion and latest updates.


Tagged: