ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Removing border around Check box (https://www.excelbanter.com/excel-programming/412361-removing-border-around-check-box.html)

Flash in the Pan

Removing border around Check box
 
I have this code to create a label on a workshhet and then a check box
on top of the label

the code is:

Sub test()

'create label
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1",
Link:=False, _
DisplayAsIcon:=False, Left:=0, Top:=0, Width:=240, Height:= _
75).Select
ActiveSheet.OLEObjects(1).Object.BackColor = &HC0C0C0

'create text box
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Check Box.1",
Link:=False, _
DisplayAsIcon:=False, Left:=16, Top:=16, Width:=65, Height _
:=18).Select
ActiveSheet.OLEObjects(2).Object.BackColor = &HC0C0C0


End Sub

the problem is that I cannot remove the border surrounding the text
box and its caption. The border is actually surrounding only on the
right and bottom of the check box. I tried changing the SpecialEffect
property of the check box from sunken to flat, but that only changes
the box around the checkbox itself and not the border surrounding the
check box and its caption.

the funny thing is that is I create this same check box manually and
not programmatically, including changing the color, and this border
does not show up.

Any ideas?

Thanks




All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com