Avatar of oncall4you
Flag for Canada

asked on 

Excel Active X controls acting up and not letting me check the checkbox

I am creating a form in Excel 2013 using activeX controls.  I use VBA code to resize the rowheight to shrink and grow the areas that have more detail.  So if you check the checkbox beside a category, it opens up and unhides the controls associated with it.  Basically more check boxes and labels, as well as a text box for the "other" field.

The checkboxes have unique names and captions.  When I check the checkbox it opens up the row to show the checkboxes, but only about half of them can be checked.  The ones that can't flash briefly further down the page, but won't check.  The text boxes won't take data either.

If I go into design mode and move the check box slightly, then get out of design mode they will work.  Until I shrink the row with the associated checkbox, then when I expand it, they stop working again.

The only thing I noticed is that the "top" property for the checkbox has a value that is duplicated on other checkboxes.  When I move it around in design mode, it changes, but after the problem recurs, it is back to it's original duplicate value.

Here is a sample of the vba code I use to change the row height:

Private Sub cbReports_Click()
 If cbReports = True Then
    Selection.rowheight = 100
    ActiveSheet.cbReportsphoto.Visible = True
    ActiveSheet.lblreportsphoto.Visible = True
    ActiveSheet.cbreportsfull.Visible = True
    ActiveSheet.lblReportsFull.Visible = True
    ActiveSheet.lblreportcopies.Visible = True
    ActiveSheet.lblReportscopyReq.Visible = True
    ActiveSheet.cbReportsCopyReq.Visible = True
    ActiveSheet.lblReportsCopyCust.Visible = True
    ActiveSheet.cbReportsCopyCust.Visible = True
    ActiveSheet.lblReportsCopyOther.Visible = True
    ActiveSheet.cbReportsCopyOther.Visible = True
    ActiveSheet.tbReportsCopyOther.Visible = True
    Selection.rowheight = 25
    ActiveSheet.cbReportsphoto.Visible = False
    ActiveSheet.lblreportsphoto.Visible = False
    ActiveSheet.cbreportsfull.Visible = False
    ActiveSheet.lblReportsFull.Visible = False
    ActiveSheet.lblreportcopies.Visible = False
    ActiveSheet.lblReportscopyReq.Visible = False
    ActiveSheet.cbReportsCopyReq.Visible = False
    ActiveSheet.lblReportsCopyCust.Visible = False
    ActiveSheet.cbReportsCopyCust.Visible = False
    ActiveSheet.lblReportsCopyOther.Visible = False
    ActiveSheet.cbReportsCopyOther.Visible = False
    ActiveSheet.tbReportsCopyOther.Visible = False
    End If
End Sub

You can see in the attached file screenshot, where the outside lab services checkbox has an errant check box below it. That ONLY appears when the mouse button is held down clicking on the Other checkbox above it that is clicked and it never unchecks.

Microsoft ExcelMicrosoft DevelopmentVisual Basic.NET

Avatar of undefined
Last Comment

8/22/2022 - Mon