If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Reference Label on Worksheet

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-09, 09:31
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Reference Label on Worksheet

Hi

I have a label from the Controls Toolbox on a worksheet. I would like to set a programmatic reference to it. How would I do so please?

e.g.
Code:
Dim l As MSForms.Label

Set l = ActiveSheet.Shapes("LabelName")
This fails of course - how can I get an early bound reference please?

Thanks
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #2 (permalink)  
Old 10-21-09, 11:24
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
For ActiveX objects, something like this should do the trick:
Code:
Sub foo()
    Dim lbl As MSForms.Label
    
    Set lbl = Sheet1.OLEObjects("Label1").Object
    
    'etc...
    
End Sub
Hope that helps...
Reply With Quote
  #3 (permalink)  
Old 10-21-09, 12:03
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Nnnng! So close (one attempt was just like that but I missed the .Object bit).

Thank you very much
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On