Consulting

Results 1 to 2 of 2

Thread: Select OLEobject checkbox PROGRAMMATICALLY???

  1. #1
    VBAX Newbie
    Joined
    Aug 2011
    Posts
    2
    Location

    Select OLEobject checkbox PROGRAMMATICALLY???

    Hi evrybody,
    I have an interesting question. I have an Excel workbook with only one Excel sheet on which I created a commandbutton. My intention is to generate an activeX control checkbox on the same Excel sheet after this command button is clicked and then check this checkbox PROGRAMMATICALLY. The former task of creating an activeX control checkbox is sucessfully done but I don't know how to come up with a solution for the latter.
    The associated click event VBA code done so far for this command button is as follow:

    [VBA]Private Sub CommandButton1_Click()

    Dim mybox As New OLEObject

    'create CheckBox
    Set mybox = ActiveSheet.OLEObjects.Add(ClassType:="forms.CheckBox.1")

    'specify geometric properties
    With mybox
    .Left = 380
    .Top = 29
    .Width = 100
    .Height = 18
    End With
    '?????????????????????????????
    'how to check the created checkbox PROGRAMMATICALLY???
    '?????????????????????????????
    End Sub
    [/VBA]
    Can anyone give me a hand???
    Thank you very much in advance,

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    See my reply at MrExcel.

    For crossposting see: http://www.excelguru.ca/node/7

Posting Permissions

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