How to set focus to ActiveX Combobox

AlexExcel2021

New Member
Joined
Feb 23, 2023
Messages
25
Office Version
  1. 2021
Platform
  1. Windows
I adding ActiveX Combobox to sheet, all working fine, but unfortunately focus still stored on Excel cell, any typing any characters captured by Excel, not my ActiveX component.
I try to use various methods like Combo.Visible = False/True, but this is not help me, and Excel sheet still capture characters firstly.
Only if I manually move focus by click on DropButton of Combobox, focus moved to Combobox.
How to set focus inside ActiveX Combobox?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try:

VBA Code:
Sub combofocus()
  ComboBox1.Activate
End Sub
 
Upvote 0
@DanteAmor , unfortunately your way don't working. And Visible = False/True don't working too.
Look look to the first screen please. This is a state exactly after Combobox has been created. But Excel Sheet still capture keyboard.
On the second screen, when I populate Combobox by clicking DropdownButton of Combobox - only in this case Combobox start capture entering, as you can see - visually this is different picture.
 

Attachments

  • Macro_03012023_075703_1.gif
    Macro_03012023_075703_1.gif
    110.9 KB · Views: 11
  • Macro_03012023_075731_1.gif
    Macro_03012023_075731_1.gif
    109.7 KB · Views: 11
Upvote 0
You can share your file with the code to review it.
You should explain step by step what I need to do to reproduce the failure and exactly what should happen.

You could upload a copy of your file to a free site such www.dropbox.com or google drive. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
@DanteAmor , Thank you for proposal. This is my issue with focus. Need to click for first column and only cells capture user input instead Combobox.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top