Well the first thing that comes to mind is the possibility that
the machine with the problem is not running Excel 2003.
If it is running XL 2003, then what happens if you stick an
"on error resume next" in the code?
That could possibly pinpoint the problem area for you, if a button or
something else is missing.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
"Brad Carman"
<(E-Mail Removed).(donotspam)>
wrote in message
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 tools>addins.. 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