Solved

VB SendKey Problem

Posted on 1999-01-20
4
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
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.

752 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