Consulting

Results 1 to 2 of 2

Thread: ActiveX Controls... Another Question!

  1. #1
    VBAX Newbie
    Joined
    May 2008
    Posts
    3
    Location

    Exclamation ActiveX Controls... Another Question!

    In other post: ../showthread.php?t=19916 I discover how to loop through the ActiveX controls (option buttons, checkboxes,...) in one presentation.

    [vba]Private Sub CommandButton1_Click()
    Dim sldTemp As Slide
    For Each sldTemp In ActivePresentation.Slides
    Dim shpTemp As Shape
    For Each shpTemp In sldTemp.Shapes
    If shpTemp.Type = msoOLEControlObject Then
    If TypeName(shpTemp.OLEFormat.Object) = "CheckBox" Then
    shpTemp.OLEFormat.Object.Value = False
    End If
    End If
    Next
    Next
    End Sub[/vba] Now, I need to know, how can I access a specific control using his "name property". Here is a Excel VBA code that uses a similar idea.

    [vba]
    For i = 1 To 4
    strAcell = "a" & i
    strBcell = "b" & i
    strCcell = "c" & i
    strDcell = "d" & i
    '...
    ograph.Application.DataSheet.Range(strAcell).Value = 20 * i
    ograph.Application.DataSheet.Range(strBcell).Value = 20 * i
    ograph.Application.DataSheet.Range(strCcell).Value = 20 * i
    ograph.Application.DataSheet.Range(strDcell).Value = 20 * i
    '...
    Next i[/vba]
    Thanks, Messinho

    ~Cleaned up post. Please don't nest board tags inside VBA tags
    Regards, Oorang

  2. #2
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    If you know the shapes name then you can use

    [vba]
    Activepresentation.slides(1).shapes("Name").???
    [/vba]

    Where "Name" is the name of the control and ??? is properties of the shape.
    Cheers
    Andy

Posting Permissions

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