Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

NamedRange.NumberFormatLocal Property

Gets or sets the format code for the NamedRange control in the language of the user.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in microsoft.office.tools.excel.dll)

public Object NumberFormatLocal { get; set; }

Property Value

The format code for the NamedRange control in the language of the user.

The Format function uses different format code strings than do the NumberFormat and NumberFormatLocal properties.

The following code example uses the NumberFormat property to format a date string in a NamedRange. The example also uses the NumberFormatLocal property to display the date format in the language of the user.

Microsoft.Office.Tools.Excel.NamedRange formatRange;
private void ApplyNumberFormatting()
{
    formatRange = this.Controls.AddNamedRange(
         this.Range["C1", missing], "formatRange");

    this.formatRange.Value2 = "4-Apr-1974";
    this.formatRange.NumberFormat = "m/d/yyyy";

    // Display the number format in the language of the user.
    MessageBox.Show("The number format for the NamedRange is: " +
        this.formatRange.NumberFormatLocal.ToString());
}

Show:
© 2015 Microsoft