Results 1 to 5 of 5
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cascading cells context menu (2000 sp-3/ 98SE)

    Before posting my code, I'm wondering if cascading/ fly-out menu items actually work, when replacing the "cells" right-click context menu. All of the menu items I add using .Controls.Add(Type:=msoControlButton) appear OK, and the code that adds the sub-menu and its items is actually executing, but it's only the former "individual" items that are appearing. There is no indication at all of my msoControlPopup sub-menu, or its items.

    Alan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cascading cells context menu (2000 sp-3/ 98SE)

    I just tested (in Excel 2002, admittedly), and submenus work as intended. I don't have to set the .Visible property to True explicitly, but you could see if that helps.

    It might be a good idea to post your code, or a workbook containing the code.

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cascading cells context menu (2000 sp-3/ 98SE)

    I've attached a (hopefully correct) abridged version of the code. As I said, it all comes up as expected except for the sub-menu and its items.

    thanks
    Alan

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cascading cells context menu (2000 sp-3/ 98SE)

    The problem is in the instruction

    Set cCommandBarFormat = _
    cCommandbar.Controls.Add(msoControlPopup)

    At that point, cCommandBar is undefined - you haven't set this variable again after re-creating the popup menu. You don't get a warning about this because On Error Resume Next is in force.

    Replace the instruction with

    Set cCommandBarFormat = _
    .Controls.Add(msoControlPopup)

    or set the cCommandBar variable after creating the popup menu.

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cascading cells context menu (2000 sp-3/ 98SE)

    Well caught! Thanks Hans. I stared at it for ages, but didn't pick up on the fact that "cCommandbar Is Nothing" if that code is executing. Now it's obvious <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    cheers <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Alan

Posting Permissions

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