次の方法で共有


WorksheetBase.ConsolidationOptions Property

Definition

Gets a three-element Array of consolidation options.

public:
 property System::Object ^ ConsolidationOptions { System::Object ^ get(); };
public object ConsolidationOptions { get; }
member this.ConsolidationOptions : obj
Public ReadOnly Property ConsolidationOptions As Object

Property Value

A three-element Array of consolidation options.

Examples

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();
        }
    }
}
Private Sub ShowConsolidationOptions()
    If Not (Me.ConsolidationOptions Is Nothing) Then
        Dim options As Array = CType(Me.ConsolidationOptions, Array)

        Me.Range("A1").Value2 = "Use labels in top row"
        Me.Range("A2").Value2 = "Use labels in left column"
        Me.Range("A3").Value2 = "Create links to source data"

        Dim i As Integer
        For i = 1 To 3
            If CBool(options.GetValue(i)) Then
                Me.Range("B" + i.ToString()).Value2 = "True"
            Else
                Me.Range("B" + i.ToString()).Value2 = "False"
            End If

            Me.Columns.AutoFit()
        Next i
    End If
End Sub

Remarks

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

Applies to