Hi all,
The code written below works well on my computer with Excel 2000 SP1.
It does not work on the same machine with Excel 2000 SP3 (Excel.exe file
version:9.0.0.6627)
It works well on the same machine with Excel 2000 SP3 sercurity
update(Excel.exe file version:9.0.0.8216).
And I'm looking for the MSDN article concerning this in order to report the
phenomenon to my client.
In http://support.microsoft.com/kb/830349/ , there's no such article.
Does anyone know about that?
'-----This code adds a menu on the worksheet menu bar.
'And when you click [Test]->[DisplayTestMessage] ,
''OK' is displayed unless your Excel is Excel 2000 SP3 early version
Public Const sMenuBarName As String = "Test"
Sub AddMenu()
Set cstMenu = Application.CommandBars("Worksheet Menu
Bar").Controls.Add(Type:=msoControlPopup, temporary:=True)
cstMenu.Caption = sMenuBarName
With cstMenu
Set cstChildMenu = .Controls.Add(Type:=msoControlButton)
cstChildMenu.Visible = True
cstChildMenu.Caption = "DisplayTestMessage"
cstChildMenu.OnAction = "'Test ""OK""'"
End With
End Sub
Public Sub Test(ByVal sStr as String)
MsgBox(sStr)
End Sub
Sub DeleteMenu()
Application.CommandBars("Worksheet Menu Bar").Controls(sMenuBarName).Delete
End Sub
Bookmarks