Hello Developers and other, :)
I'm developing a macro to create a lot of button automatically, and I wants to give them a specific background color.
With Worksheets("Sheet 1")
Set r_BtnRange = .Range("O3:O4")
For Each r_Cell In r_BtnRange.Cells
Set b_Btn = .Buttons.Add(r_Cell.Left, r_Cell.Top, _
r_Cell.Width, r_Cell.Height)
With b_Btn
.Caption = "Email End-User"
.OnAction = "Email_EndUser"
.Font.Color = RGB(255, 255, 255)
'.BackColor = 16711680
End With
Next
End With
The .Button.Add return a Button Object, witch has no BackColor Proprety (according to this: https://learn.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.button?view=excel-pia and the fact I receive an error when tying to uncomment the line)
I could use a Shape to do it, but I would know if there is really any method to do it (btw, had to disable it and modify multiple propriety of it.
Thanks a lot for your answers,
Antoine