Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB SendKey Problem

Posted on 1999-01-20
4
Medium Priority
?
322 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 150 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

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.

Question has a verified solution.

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

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
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: …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

688 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