Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not too familar with this error, and new to working with toolbars in
VBA, so I'm lost on even what to look for on this error. The code so far is: Option Explicit Public Const runCreatetribalTR As String = "RunCreateTribalTR" Sub Auto_Open() Call CreateMenubar With CommandBars("CreateTR") .Enabled = False .Visible = False End With End Sub Sub Auto_Close() Call RemoveMenubar End Sub Sub RemoveMenubar() On Error Resume Next Application.CommandBars(runCreatetribalTR).Delete On Error GoTo 0 End Sub Sub CreateMenubar() Call RemoveMenubar With Application.CommandBars.Add .Name = runCreatetribalTR .Left = 200 .Top = 200 .Protection = msoBarNoProtection .Visible = True .Position = msoBarTop .Left = CommandBars("RunCreateTribalTR").Left + CommandBars("RunCreateTribalTR").Width .RowIndex = CommandBars("RunCreateTribalTR").RowIndex With CommandBars("RunCreateTribalTR").Controls.Add(Type :=msoControlButton) .OnAction = "'" & ThisWorkbook.Name & "'!" & "CreateTR" .Caption = "CreateTR" .Style = msoButtonCaption .TooltipText = "Create TR" End With ' With CommandBars("RunCreateTribalTR").Controls.Add(Type :=msoControlButton) ' .OnAction = "'" & ThisWorkbook.Name & "'!" & "MergeCells" ' .Caption = "Merge Cells" ' .Style = msoButtonCaption ' .TooltipText = "Merge/Unmerge Cells" ' .BeginGroup = True ' End With With CommandBars("RunCreateTribalTR").Controls.Add(Type :=msoControlButton, ID _ :=2950, Befo=3) <----SUBSCRIPT OUT OF RANGE End With End With End Sub Public Sub CreateTR() Call CreateTribalSheet End Sub I've marked the error line above. Can anyone please help me here? Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error - Subscript out of range despite On Error statement | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Type Mismatch error & subscript out of range error | Excel Programming | |||
Subscript Out Of Range Error? | Excel Programming |