Consulting

Results 1 to 8 of 8

Thread: KeyCode = 9 Combobox Disappears

  1. #1
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location

    KeyCode = 9 Combobox Disappears

    I am having issues with the ActiveX Controls on a spreadsheet. I have 3 Comboboxes and 2 textboxes. I use KeyCode 9 to tab threw the controls, but noticed that when I tab over instead of making that control activate, it's disappearing.

    [VBA]Private Sub txtBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode = 9 Then
    CmbResolution.Activate
    End If
    End Sub[/VBA]

    I don't understand why, but if i click somewhere on the spreadsheet it re-appears. Not sure if this a known issue with keycode and comboboxes.
    I am using excel 2007.

    Any ideas how to fix this?

  2. #2
    Perhaps there are two controls on top of each other?
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    I discovered what's causing the issue, not sure if someone seen this before or this is a bug.

    I have the controls in row 1 and I froze the top row which contain these controls. So when the row is frozen and I tab from 1 control to another it disappears. But everything works perfectly when Everything is unfrozen.

    Any Solutions?

  4. #4
    Do any of the controls "touch" the bottom cell border and thus cross the frozen boundary?
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  5. #5
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    No, no controls touch any other cell then there cell in row 1

  6. #6
    I'm afraid I have no asnwer. Excel has never really liked the ActiveX controls much and unfortunately, this has not become better over the versions.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  7. #7
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,645
    Refreshing the sheet (e.g. switching between sheets) will return everything to 'normal'

  8. #8
    VBAX Newbie
    Joined
    May 2015
    Posts
    1
    Location
    Quote Originally Posted by snb View Post
    Refreshing the sheet (e.g. switching between sheets) will return everything to 'normal'
    If you don't want to reactivate the sheet because you have a macro on sheet activation you can place another line after combobox.activate (which activate the combobox but somehow also hideit from the view) you can put a line on size or position that will make the combo box visible like: combobox.top = combobox.top

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •