Q:

csharp interop excel: how to accessing to pre-formatted styles like "accounting formatting"?

How to accessing to a pre-formatted styles like "accounting formatting" in c# with Excel Interop ? please
table.ListColumns["MONTANTS"].DataBodyRange.NumberFormatLocal = "# ##0,00 €";
table.ListColumns["MONTANTS"].DataBodyRange.NumberFormat = InteropExcel. ENUM ?

I'm looking for set table.ListColumns["MONTANTS"].DataBodyRange.NumberFormat to a "accounting format"

A:

I've not tested this.
According to this article, just use:
table.ListColumns["MONTANTS"].DataBodyRange.NumberFormatLocal = "Accounting";

The number format is specified using the same format codes displayed on the Number tab of the Format Cells dialog box. You can use a built-in number format, for example "General".

I suppose you could make a convenience enum with all the built-in formats.

