Results 1 to 7 of 7

Click event of dynamically created label

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Click event of dynamically created label

    Hi

    I am adding label to my excel sheet using OLEObjects.Add as seen below.
    This works fine.

               
        Dim v_ole As OLEObject                  'z
        Dim v_label As MSForms.Label          'x
    
    Set v_ole = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1", Link:=False, _
                DisplayAsIcon:=False, Left:=370, Top:=45, Width:=46, Height:=18)
    
                Set v_label = v_ole.Object
                With v_label
                    .Font.Name = "Arial Narrow"
                    .Font.Size = 11
                    .Font.Bold = True
                    .Font.Underline = True
                    .TextAlign = fmTextAlignRight
                End With
                With v_ole
                    .Object.Caption = "Remove"
                    .Object.ForeColor = &H80000002
    '                .Object.OnAction = "RemoveClicked"
                End With
                Set v_ole = Nothing
                Set v_label = Nothing

    How do I write the code that will fire when user clicks these labels?
    tia
    Ajay
    Last edited by ajaykgarg; 07-03-2010 at 10:10 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1