Solved

VB SendKey Problem

Posted on 1999-01-20
4
309 Views
Last Modified: 2006-11-17
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
Comment
Question by:ecj1
  • 2
  • 2
4 Comments
 

Author Comment

by:ecj1
ID: 1615842
Edited text of question
0
 
LVL 12

Accepted Solution

by:
jgv earned 50 total points
ID: 1615843
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
 
LVL 12

Expert Comment

by:jgv
ID: 1615844
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
 

Author Comment

by:ecj1
ID: 1615845
jgv,

many thanks for you help.

ecj1
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had the experience that you had to follow 10 steps over and over again every time when you need to nicely forward an important email to your manager? Fear no more! With the help of the Quick Steps feature in Outlook 2010, your old chor…
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question