The problem is that a chart sheet has a different menu bar than a worksheet. Open a workbook that contains at least one worksheet as well as a chart sheet. Now drag the menubar from the worksheet down over the sheet (undock it). Look at the name and the contents. Now do the same for the menu bar over the chart sheet. Notice it not only has different content, but also a different caption. These are two separate CommandBars.
So, when you run your code it deletes the control, then recreates it, removing it from the worksheet menubars and adding it to chartsheet menubars.
-- Cindy Meister (Word MVP) |