Solved

SendKeys and dropdown list not working

Posted on 2009-06-30
2
556 Views
Last Modified: 2013-11-10
Hi everyone,
I'm trying to use SendKeys to choose an option off of a dropdown list, but it's ignoring the choice I'm trying to send it.  I've copied the code for you to review.  
Field 1274 is my dropdown list.
I have tried sending every choice on the list, but what happens is the dropdown list opens, chooses nothing, closes and then none of the SendKeys after that do anything.  The only way I was able to to get it to choose an option was to send a DOWN (currently commented out) to take the last choice off the list, but then as before, none of the keys after that do anything anyway.
If I manually press the keys on the keyboard, it works so I know I have the right keystrokes here.
Deanna.Screen.SetCursor 1274, frmMain
                    
                  ' SendKeys "{DOWN}", True        Only thing that chooses an option
                    SendKeys "B", True
                    SendKeys "{TAB}", True          
                    SendKeys "1", False
                    SendKeys "{TAB}", False
                    SendKeys "{TAB}", False
                    SendKeys "{TAB}", False
                    SendKeys "{TAB}", False
                    SendKeys "{TAB}", False
                    SendKeys "{DOWN}", False
                    SendKeys "{TAB}", False
                    SendKeys "{+}", False
                    SendKeys "{TAB}", False

Open in new window

0
Comment
Question by:DeannaF829
[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 Comments
 
LVL 15

Expert Comment

by:SRigney
ID: 24747211
it may be that the wrong thing has focus.

It may be the version of the OS you are running on.  Vista does not properly support SendKeys.
0
 

Accepted Solution

by:
DeannaF829 earned 0 total points
ID: 24828143
I gave up on this
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

734 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