index > Visual Studio Tools for Office > custom command bar menu disappears off one sheet but appears on a...

custom command bar menu disappears off one sheet but appears on a...

I have added a custom button to my vsto excel project.

Alisa619

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)
Cindy Meister

Thank you for the explaination, is there a way i can fix it so it doesn't happen? i will be needing to release this to clients.

thank you




Alisa
Alisa619
Not knowing the logic of your entire solution, I can't tell you exactly what you need to do. But logically I'd say you need to construct the code so that it checks for the presence of the control in both the worksheet as well as the chart sheet menu bars. Rather than using "ActiveMenuBar", check the exact caption: CommandBars("Worksheet MenuBar") for example.


-- Cindy Meister (Word MVP)
Cindy Meister

call the CheckIfMenuBarExists after each excel button click event. This all started because I noticed that the "delete" and various other built in command button were being disabled whenever a report was ran or a chart. So I first run ResetCommnadBars , then I have it call CheckIfMenuBarExists then it adds the my command button.

Alisa619
reply 5

You can use google to search for other answers

 

More Articles

• Microsoft? Office Access 2003 Developer Extensions
• Using "Windows Media Player Plug-in Wizard" in VS2005
• Word Interop Hangs When Deployed To Server - Help!
• VSTO Excel deployment problem
• Developing a custom data connection in Excel 2007
• Deploying VSTO Word Project: could not find or load customization...
• infopath 2003 toolkit for visual studio 2005?
• Seroius error while having combobox into each column's cells
• how to display images in infopath?
• Outlook and Word Addins
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• VSTO 2005 application manifest
• Adding controls at runtime resulting error
• Publish to SharePoint?
• Selected Text
• Microsoft Office Information Bridge Fram
• vb.net vs2005 excel 2003 chart
• c# counterpart of VBA for Excel
• Publishing Excel doc on shared drive
• How To Open Multiple Documents
• Export Data to Excel
• How to add SmartTags in Outlook
• VS2005, office projects do NOT appear, e
• How to set a Custom Color?
• Excel ListObject Problems
• Word.interop - Saveas usage

Hot Articles

• XML and Word 2002
• Login control into VSTO/Excel
• Trying to access Excel Spreasheet from V
• How do I get a "Quiet" install
• Setting focus to a word document
• VSTO Word Template & Custom Menus/To
• Unable to load Outlook Add-In
• Multiple Office Version Development
• Table.ID doesn't retain its value
• Excel Range
• check to see if the sent mail is a reply
• Event for text change
• VSTO and MS Project
• Microsoft.Office.Tools.Word.XMLNode.Cont
• Error while setting BorderStyle for Styl

Recommend Articles

• Cells.NumberFormat - not standart (from
• Error 0x80131107 running Add-In
• Can't update MS Access with C++
• VSTO 2005 Beta2 Bookmark Relocate
• VSTO installation
• Collapsible Actions Pane sections
• rtf/wmf question
• Add Worksheet From template
• Display Alerts?
• URGENT: Cannot Install VSTO June 2006 CTP!
• Capture Word Document Keyboard events fr
• Project server error
• Deploying a Word Solution with an Action
• Locating XSD for Word app
• Rename print job from Excel