Solved

SendKeys and dropdown list not working

Posted on 2009-06-30
2
550 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
incorrect syntax near the order by 10 56
Developing a front end to SPLUNK 1 52
IDE for Python 5 62
instagram media_id Grabber by TAG 1 24
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn different types of Android Layout and some basics of an Android App.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

685 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