modification to suit Excel 2000

T

Tony

I have created procedures which run properly on Excel
2002. I need to run them on Excel 2000 but I do not have
access to this older version any more. Could you please
have a look on the code below and let me know what I
should change to have it running error free ?

Sub Workbook_Open()

Dim c As CommandBar
Dim cb As CommandBarButton
Dim cp As CommandBarPopup

On Error Resume Next
Set c = Application.CommandBars("Worksheet Menu Bar")
If Not c Is Nothing Then
Set cb = c.Controls.Add(msoControlButton, 2,
temporary:=True)
cb.Style = msoButtonCaption
cb.Caption = "Calculate Totals"
cb.OnAction = "Template.xls!
ThisWorkbook.CalculateTotals"
End If

End Sub

Thanks for help.

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top