VBA (Not VB) -- How to expand comboBox dropdown when the editable area gets focus

I have a comboBox on an excel spreadsheet, and I want to open (expand) the dropdown list when the user clicks in the editable area.  I have the following code, but it doesn't work:

Private Sub Wordbox_GotFocus()
      Dim retv as long
      retv = SendMessageLong(Wordbox.hwnd, CB_SHOWDROPDOWN, True, 0)
End Sub

This code fails because VBA doesn't have a hwnd property for combo boxes, so the first parameter causes an error.

I tried to get the comboBox's handle like this:

Dim TheHandle As Long
TheHandle = FindWindow("ComboBox", "Wordbox")

But the FindWindow API returned zero. (Probably I didn't send the right parameter values, but I don't know what to send.

(Yes, I have the API declarations -- omitted for brevity.)

Can anyone tell me how to open the list when a VBA combobox gets focus?
pziemerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ComputronCommented:
or use SENDKEYS "% {DOWN}" or SENDKEYS "{F4}"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pziemerAuthor Commented:
Nice, clean solution -- and no APIs.

My combobox, named "Wordbox",  is on a worksheet.  Here's the working code.

Private Sub Wordbox_GotFocus()
    Wordbox.DropDown
End Sub

Thanks.
ComputronCommented:
They must have just added that in 2K3, I hadn't seen it before either.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.