Wikipedia

Search results

Build an Excel Add-In





Private Sub Workbook_AddinInstall()



On Error Resume Next 'Just in case

    'Delete any existing menu item that may have been left.

    Application.CommandBars("Worksheet Menu Bar").Controls("frmehs").Delete

    'Add the new menu item and Set a CommandBarButton Variable to it

    Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add

    'Work with the Variable

        With cControl

            .Caption = "Elsevier - HS"   'caption

            .Style = msoButtonCaption 'button type

            .OnAction = "FORMSHOW_HS" ' procedure name

            'Macro stored in a Standard Module

        End With

        
    On Error GoTo 0


End Sub

regards,
Vikas Verma

No comments:

Post a Comment