I have below line of code to display total value
objxlWs.Cells(lngFooterRow, i).Value = CDbl(FormatNumber((CDbl(arr_totals(1, i))), arr_columns(1, i), , , ))
at the time of debug above line of code is giving
-151306.29
after that I have below code for formatting
Dim GrandTotalStyle As Style
GrandTotalStyle = xlWb.CreateStyle()
GrandTotalStyle.Font.Name = “Arial”
GrandTotalStyle.Font.Size = 8
GrandTotalStyle.Font.IsBold = True
GrandTotalStyle.Font.Color = Color.Black
GrandTotalStyle.ForegroundColor = Color.Orange
GrandTotalStyle.Pattern = BackgroundType.Solid
GrandTotalStyle.Custom = “#,##0.00;#,##0.00”
Dim GrandTotalFlag As New StyleFlag()
GrandTotalFlag.NumberFormat = True
GrandTotalFlag.Font = True
GrandTotalFlag.Borders = True
GrandTotalFlag.CellShading = True
GrandTotalRange.ApplyStyle(GrandTotalStyle, GrandTotalFlag)
If I comment below code then valueis coming with sign but commas are missing. Pls help
GrandTotalStyle.Custom = “#,##0.00;#,##0.00”