This documentation is archived and is not being maintained.

WorksheetBase.ConsolidationOptions Property

 

Gets a three-element Array of consolidation options.

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public object ConsolidationOptions { get; }

Property Value

Type: System.Object

A three-element Array of consolidation options.

If an element in the returned array is true, then the corresponding option is set. The three elements in the array are:

Element

Meaning

1

Use labels in top row

2

Use labels in left column

3

Create links to source data

The following code example uses the ConsolidationOptions property to display the values of the consolidation options for the current worksheet.

This example is for a document-level customization.

private void ShowConsolidationOptions()
{
    if (this.ConsolidationOptions != null)
    {
        Array options = (Array)this.ConsolidationOptions;

        this.Range["A1"].Value2 = "Use labels in top row";
        this.Range["A2"].Value2 = "Use labels in left column";
        this.Range["A3"].Value2 = "Create links to source data";

        for (int i = 1; i <= 3; i++)
        {
            if ((bool)options.GetValue(i))
            {
                this.Range["B" + i.ToString()].Value2 = "True";
            }
            else
            {
                this.Range["B" + i.ToString()].Value2 = "False";
            }
            this.Columns.AutoFit();
        }
    }
}
Return to top
Show: