VBA-Problem: dynamic gerneration of Buttons in Excel - set the caption?
Posted on 2003-03-19
I want to generate buttons in Excel dynamically.
I did this using:
Set bu = ActiveWorkbook.ActiveSheet.Shapes.AddFormControl(xlButtonControl, Left:=150, Top:=30, Width:=100, Height:=12)
bu.Name = "Button1"
bu.OnAction = "run1"
But I found no property or method to set the caption of the button. There is always a "Standard Caption" (Schaltfäche ## in German version)
Please don't give me solutions with using OLEObjects.Add("Forms.CommandButton.1"),...