Font Size on Command Buttons - VBA

  • Thread starter Thread starter tcb
  • Start date Start date
T

tcb

When I create a command button I can do all of the below except set
the FontStyle. What is the correct syntax for this?

With objActiveWkb.ActiveSheet.OLEObjects.Add("Forms.CommandButton.
1")
.Left = intLeft
.Top = intTop
.Object.Caption = strButtonCaption
.Width = intWidth
.Height = intHeight
.Object.Wordwrap = True
.Object.Font.Size = 10
' .FontStyle = "Bold"

End With
 
How about just

.object.fontbold = true

I don't think there's a .fontstyle associated with this. I didn't see it when I
added an oleobject to the watch window.
 
Back
Top