Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

VB SendKey Problem

I am currently automating the edit comment procedure within Excel 97 using VB.  I am using the SendKey command to enter text into a comment field:
Application.SendKeys ("%IE")
This works successfully but the menu remains active on the window and requires a "return" to disappear and activate the comments window.  I have tried using variations on the following:
Application.SendKeys ("%IE {ENTER}")
to try and resolve this, all to no avail.

Best regards,

Rob.
0
ecj1
Asked:
ecj1
  • 2
  • 2
1 Solution
 
ecj1Author Commented:
Edited text of question
0
 
jgvCommented:
You could try splitting the action and have the VB app wait until the first set of keys are processed ("%IE", True) before sending the ENTER key.

Application.SendKeys "%IE", True
Application.SendKeys "{ENTER}", True


0
 
jgvCommented:
ecj1:

For some reason sending Enter as {ENTER} does not work in this case. Use:

Application.SendKeys "%IE~"

The ~ is recognized as the ENTER key and does work.
0
 
ecj1Author Commented:
jgv,

many thanks for you help.

ecj1
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now