Excel 2007 Ribbon Will Not Re-Validate Unless Excel Window Has Focus

T

TWR

0 down vote favorite


I am experiencing a strange problem. I have a custom Ribbon in Excel
2007 (built using RibbonX). Certain tabs in the ribbon are dynamically
hidden and dropdowns are dynamically populated. This means that when
the use takes certain actions the ribbon must be invalidated so it can
be re-drawn.

This works 100% of the time when the user has window focus on Excel.
However, if the user clicks my "Refresh" button which takes a couple
seconds to grab new data from the server, and they then move to
another application (i.e. Excel loses window focus) then when the
ribbon tries to re-validate it throws errors.

The only difference I can determine between error and no error is
whether the Excel window has focus.

Has anyone ever heard of this or perhaps knows a way to fix it. I can
see a couple potential solutions (in order of preference).

1. Make it so the ribbon does not require Excel window focus.
2. Somehow bring the window focus back to Excel automatically right
before we call Invalidate on the ribbon
3. Force the user to wait for the Refresh to complete. They cannot
change window focus.

Any suggestions are greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top