Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a subroutine that is called from an Auto_Open subroutine that is shown
below. I have narrowed it down to this code as being the reason for excel crashing on startup. Excel recoginizes that my Addin is the reason for the problem and askes if I want to disable it. When that is done Excel starts just fine. When I go to toolsaddins.. and start my Addin up everything runs fine, no errors are encountered. So why does this code create an error when excel is starting as compared to after it has finished booting up? Thanks for any help!! Here is my code... Sub CreateRightClick() Dim btn As CommandBarButton Dim btn2 As CommandBarButton Dim barArray As Variant Dim i barArray = Array("List Range Popup", "Cell", "Column", "Row") For i = LBound(barArray) To UBound(barArray) With Application.CommandBars(barArray(i)) .Reset Set btn = .Controls.Add(Temporary:=True) btn.BeginGroup = True btn.Caption = "Apply Throughout" btn.OnAction = "ApplyThroughout" btn.FaceId = 201 Set btn2 = .Controls.Add(Temporary:=True) btn2.Caption = "Calculate Cells" btn2.OnAction = "ReCalcHighlighted" btn2.FaceId = 202 End With Set btn = Nothing Set btn2 = Nothing Next i End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
adding code to command button in word from excel VBA | Excel Programming | |||
CommandBars vs CommandBars(1).Controls | Excel Programming | |||
Adding .xla button for Toggle Calculation Button | Excel Programming | |||
adding a command button to an excel cell? | Excel Discussion (Misc queries) | |||
Adding a button to Excel, need help please | Excel Programming |