XlDialogApplyStyle problem selecting font color.

Cantieri, Cesare 1 Reputation point
2021-05-05T15:09:24.827+00:00

We are developing a VSTO Excel add-in which provides the possibility to define and edit styles of the current workbook. To accomplish this feature the add-in

  • Activates a workbook which contains styles already applied at least in one cell;
  • Open the XlDialogApplyStyle built-in dialog in order to allow the user to make any kind of change to the styles.

While the user try to select a color for the font then the XlDialogApplyStyle dialog and others being opened consequently, deactivates and the user needs to press alt+tab to go back to the dialog. After the first try the problem does not occur again since the XlDialogApplyStyle is open again.
This problem has never happened for ages until a few months ago when it started to occur just in some computers and now it is getting more frequent day by day.
Using the same dialog directly from Excel menu works properly.
We were not able to identify a specific Excel version nor vsto nor windows version or any other characteristic responsible for the problem.

The code we use to synchronously open the dialog is as follows:

Globals.ThisAddIn.Application.Dialogs[XlBuiltInDialog.xlDialogApplyStyle].Show(
"styleName", Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);

What can cause this annoying problem? Is there a way to avoid it?

Cesare

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,294 questions
0 comments No comments
{count} votes