Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create new commandbar with call procedure
Hi,
Anybody pls. kindly give me the sample of coding that create new commandbar with one commandbarbotton while opening workbook. This commandbarbotton can call one sub procedure in program. Thks for any help. Tonmai K. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create new commandbar with call procedure
one way:
Call this from the Workbook_Open procedure, i.e.: Private Sub Workbook_Open() CreateToolBar End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) DestroyToolBar End Sub And in a regular module: Public Sub CreateToolBar() On Error Resume Next CommandBars("Tonmai Bar").Delete On Error GoTo 0 With CommandBars.Add(Name:="Tonmai Bar", _ Position:=msoBarFloating, Temporary:=True) .Top = 100 .Left = 500 With .Controls.Add(Type:=msoControlButton) .FaceId = 2950 .OnAction = "MySub" End With .Visible = True End With End Sub Public Sub DestroyToolbar() On Error Resume Next CommandBars("Tonmai Bar").Delete On Error GoTo 0 End Sub In article , "Tonmai" wrote: Hi, Anybody pls. kindly give me the sample of coding that create new commandbar with one commandbarbotton while opening workbook. This commandbarbotton can call one sub procedure in program. Thks for any help. Tonmai K. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
call procedure problem | Excel Discussion (Misc queries) | |||
to call procedure in a worksheet in a module | Excel Discussion (Misc queries) | |||
call procedure | Excel Programming | |||
procedure won't call | Excel Programming | |||
Run-time error '5':Invalid Procedure call or argument | Excel Programming |