Solved

SendKeys and dropdown list not working

Posted on 2009-06-30
2
540 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
Comment Utility
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
Comment Utility
I gave up on this
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now