Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Sub CommandButton1_Clk programmatically
I am trying to create a Worksheet from within a Sub procedure. I can create
a command button ActiveX control with ActiveWorkbook.Sheets.Add Type:=xlWorksheet ActiveWorkbook.ActiveSheet.Name = "mixer" ActiveWorkbook.ActiveSheet.OLEObjects.Add ClassType:="Forms.CommandButton.1", _ Link:=False, DisplayAsIcon:=False, Left:=140, Top:=30, _ Width:=100, Height:=40 ActiveWorkbook.ActiveSheet.OLEObjects("CommandButt on1"). _ Object.Caption = "Calculate" This automatically creates an associated Sub: Private Sub CommandButton1_Click() End Sub Is there any way to then complete this "stub?" That is, I'd like to put in its body "myFunction", programmatically, so it becomes: Private Sub CommandButton1_Click() myFunct End Sub TIA Ed |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help creating new hyperlinks programmatically | Links and Linking in Excel | |||
Programmatically Add Reference` | Excel Programming | |||
Programmatically Add Reference` | Excel Programming | |||
Sorting rows programmatically | Excel Programming | |||
Can i set a reference programmatically? | Excel Programming |