View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shetty Shetty is offline
external usenet poster
 
Posts: 78
Default Macro created in XL2000 not working in XL97

I have created a simple addin to run a macro through a context menu.
It works fine in XL 2000 but does nothing in XL97. Even context menu
command and icon is not created. Is there different syntext for XL2000
and XL97?

Code as below.

Regards,
Shetty

Code:
In a module:

Sub cmdadd()
With CommandBars("Cell")
With .Controls.Add
.FaceId = 1183
.Caption = "Delete Star"
.OnAction = "DeleteStar"
End With
End With
end sub

Sub DeleteStar()
Selection.Replace "~*", "", xlPart, xlByRows, False
End Sub

In this workbook code panel:
Private Sub Workbook_Open()
Call cmdadd
End Sub