Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disable a menu item (Excel 2000/SR1)

    How does one disablee/enable menu items from a workbook VBA that were created from a COM AddIn that the workbook is using?

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable a menu item (Excel 2000/SR1)

    You'll need something in the ThisWorkbook module of the workbook such as:<pre>Private Sub Workbook_WindowActivate(ByVal Wn As Window)
    With Application.CommandBars("Standard")
    .Controls(1).Enabled = False
    End With
    End Sub

    Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
    With Application.CommandBars("Standard")
    .Controls("New").Enabled = True
    End With
    End Sub
    </pre>

    HTH
    Gre

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •