+ Reply to Thread
Results 1 to 2 of 2

Commandbar/Buttons on Ribbon stopped working

  1. #1
    Registered User
    Join Date
    02-29-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    4

    Commandbar/Buttons on Ribbon stopped working

    Environment: Office 2007. Workbook originally developed on 2003 running in Compatability Mode. Win7 host.

    I have several Workbooks that I have been working with since they were originally developed in 2000. They all use Commandbars probably developed on Excel 2003. When ported to Excel 2007, the Commandbars were automatically added to the Ribbon under the AddIns Tab, just like they were supposed to. The Buttons simply call small VBA Macros that, in turn, open VBA Forms.
    Since conversion to 2007 (2-3 years ago), all have worked as expected in regular use, every day or two for the main Workbook. Suddenly, a few days ago, Clicking any of the buttons produce a "Error - 400" msgbox. This error appears when the button is clicked and prior to entering the corresponding VBA macro.
    1. Buttons appear normal with correct Images, in AddIn Tab on Ribbon.
    2. Macros run correctly when launched from VBA IDE.
    3. Click on button does not invoke the Macro as shown by setting a breakpoint in the IDE
    4. Click button - get Error 400 msgbox.
    Obviously something has changed, but I do not know where to start looking for the problem or even where to find any files that may be associated with the Commandbars.
    I mentioned that I have several Workbooks designed to use the same Commandbars. In fact, the others are earlier versions of the same Workbook. All run the same code, in the same fashion, and ALL now fail to work. It is not Workbook specific, it is Application specific.

    I am developing a VSTO (Visual Studio 2010) replacement for this Workbook family. I am creating an AddIn do replace the Ribbon/Tab/Button functionality. Basically the new AddIn works, but needs some tweaking, so I do any real work with the original, Compatability Mode Workbook. There were certainaly times when both the old Workbook and the VSTO version were running at the same time. My problem might have started when the old Workbook was launched in the Excel instance launched by VS2010. Generally I avoided that, running the old in a separate instance of Excel --- but may have slipped up once. If I clear out any link to the new AddIn, the problem remains with the old Workbooks.

    Regardless of what caused the problem, my question is - "How do I begin/ where do I look - to fix this problem?". Of course, I would also welcome a step by step solution as well.
    If necessary, I would be willing to recreate the Commandbars. Willing, but not particularly able. It has been years since I put them together in the first place and that was in Excel 2003! I have no idea how to recreate them in Excel 2007 and have quite forgotten how I did it ini Excel 2003! Any guidance in this area would also be welcome.

    Jim

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Commandbar/Buttons on Ribbon stopped working

    Hi Jim,

    Off the bat I would suspect file corruption as this commonly happens with older Excel files.There is a program called CodeCleaner than simply recreates the modules and puts the code back in to the new modules. Also if the problem is isolated to the ribbon, Microsoft MVP Ron de Bruin is the top expert on the subject. He has official MS articles on it, a book I believe and this simplified webpost. I'd recommend trying to recreate the whole workbook in a new workbook and hope that this resolves the issue. If not then use CodeCleaner as the issue may be with the underlying code that we can't see in the vba module, and if not then create the ribbon from scratch using Ron's step by step approach.

    Hope this helps.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1