Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default insert label in worksheet



Hello

I try to insert some labels in a worksheet and it works but I can't
change BackStyle to fmBackStyletransparent.

I use this code to insert the labels
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=yy, Top:=xx, Width:=102.75, Height:=
_
69.75).Name = "newLabel" & yy & xx

After I insert them I need to set BackStyle to fmBackStyletransparent
and later, if it's possible, I want to delete them.
Is there solution for that?
Sune

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default insert label in worksheet

To set it manually, you need to be in design mode. Click the icon with the
triangle and ruler. Then right click the label and select Format Object,
then click on the Colors and Lines tab. To delete the label manually, you
will also need to be in design mode.

"sune" wrote:



Hello

I try to insert some labels in a worksheet and it works but I can't
change BackStyle to fmBackStyletransparent.

I use this code to insert the labels
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=yy, Top:=xx, Width:=102.75, Height:=
_
69.75).Name = "newLabel" & yy & xx

After I insert them I need to set BackStyle to fmBackStyletransparent
and later, if it's possible, I want to delete them.
Is there solution for that?
Sune

*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default insert label in worksheet

I couldn't get the background color manually or by code, but that does not
mean it can't be done, just that I don't know how. I did get it to delete by
code. See below.

Sub dl()
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=yy, Top:=xx, Width:=102.75, _
Height:=69.75).Name = "newLabel" & yy & xx
ActiveSheet.OLEObjects("newLabel").Delete
End Sub


"sune" wrote:



Hello

I try to insert some labels in a worksheet and it works but I can't
change BackStyle to fmBackStyletransparent.

I use this code to insert the labels
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=yy, Top:=xx, Width:=102.75, Height:=
_
69.75).Name = "newLabel" & yy & xx

After I insert them I need to set BackStyle to fmBackStyletransparent
and later, if it's possible, I want to delete them.
Is there solution for that?
Sune

*** Sent via Developersdex http://www.developersdex.com ***

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default insert label in worksheet



Thanks for your help but I still need to change
backstyle = fmBackStyleTransparent

Someone know how to do that?

Sune

*** Sent via Developersdex http://www.developersdex.com ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default insert label in worksheet

Well, I could not find a way to change the BackStyle to Opaque or
Transparent, but here is the method to put a color in it.

Sub dl()
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=yy, Top:=xx, Width:=102.75, _
Height:=69.75).Name = "newLabel"
For Each obj In Sheets(1).OLEObjects
Next
With Sheets(1).OLEObjects("newLabel").Object
.BackColor = RGB(25, 125, 255)
End With
MsgBox "Observe"
Sheets(1).OLEObjects("newLabel").Delete
End Sub


"sune" wrote:



Thanks for your help but I still need to change
backstyle = fmBackStyleTransparent

Someone know how to do that?

Sune

*** Sent via Developersdex http://www.developersdex.com ***



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default insert label in worksheet

P.S. The message box is only to pause the macro so you can see the color.
It is not essential to the code.

"sune" wrote:



Thanks for your help but I still need to change
backstyle = fmBackStyleTransparent

Someone know how to do that?

Sune

*** Sent via Developersdex http://www.developersdex.com ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What does InsertNameLabel & InsertNamePaste do? Studebaker Excel Discussion (Misc queries) 2 June 12th 08 04:13 AM
What does label do under Insert, Name, Label? trainer07 Excel Discussion (Misc queries) 2 April 18th 07 01:14 PM
how is Insert, Name, Label different frm Accept labels in formula ToniM Excel Discussion (Misc queries) 1 July 12th 06 03:49 PM
Insert | Name | Label Frederick Chow Excel Discussion (Misc queries) 2 June 26th 06 05:56 PM
What does Insert>name>LABEL option do ? Ali.Abbas.810 Excel Discussion (Misc queries) 1 December 5th 04 08:40 AM


All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"