XlDialogApplyStyle problem selecting font color.
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