Custom sort data using Excel BuiltInDialog

Custom sort data using Excel BuiltInDialog

BuiltInDialog:

Each Dialog object represents a built-in dialog box. You cannot create a new built-in dialog box or add one to the collection. The only useful thing that you can do with a Dialog object is to use it with the Show method to display the corresponding dialog box.

Prerequisites:

  • Visual Studio 2015 or above having Microsoft Office for Developer Tool installed
  • Create Excel Addin in C# code style (Visual Studio Tools for Office)
  • Create a ribbon designer and put button

Code example:

private void btnCustomSort_Click(object sender, RibbonControlEventArgs e)
{
	
	excel.Dialog response = Globals.ThisAddIn.Application.Dialogs[excel.XlBuiltInDialog.xlDialogSortSpecial];
	response.Show();
	
}

Output:

Next : Create pivot table in Excel C#

Leave a Reply

Your email address will not be published.