I have a VSTO 2005 solution with some controls on the action pane that I would like to refresh when the user changes the formatting on a range. Is there a way to programatically show the Format Cells dialog using Excels built in dialogs I have tried using some of the built in dialogs that are part of the Format Cells dialog (like xlDialogFormatNumber, xlDialogAlignment etc), but I can not find one that displays the entire dialog as you would see it when clicking on "Format Cells" from the Context menu or "Cells" from the Format menu.
Thanks
Patrick Hampton

How to Show Complete Format Cells dialog
lauramc
Here's the link to the excel programming newsgroup.
http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.excel.programming&lang=en&cr=US
They should be able to provide you with more info.
regards,
Eric
Bas Pronk
You should be able to do this by using the Execute method of the CommandBars object to execute displaying the UI dialog box:
application.CommandBars.FindControl(ID:=855).Execute
This is a useful technique to access things in the UI that have no exact match in the Office object model. In order to get the ID of a control, query the UI. For example, in this case:
MessageBox.Show(application.CommandBars(1).Controls("Format").CommandBar.Controls("Cells...").ID)
learningWPF
I haven't had a chance to look at this again, because I've been pulled off on another task for the moment. However, I assume calling Execute() on the CommandBar will simply trigger the menu event handler, is this correct. If so this solution will not work for me because I need to overide the default menu hanlder to run additional code after the format cells dialog is closed.
I already have the following code to override the menu event handler:
Office.CommandBarButton menuItem = application.FindControl(855) as Office.CommandBarButton;
if (menuItem != null)
{
menuItem.Click += formateCells_Click
}
Than in the menu event handler I want to run the following code:
//TODO: Show the format cells dialog
bool ok = dialog.show;
//If the user did not cancel the action refresh our controls
if(ok)
this.myUniView.ForceRedraw();
cancelDefault = true;
dr266