I'm modifying an existing application written in vb.net. There is an export option which exports information to an excel sheet. Before exporting the cell format is defined as follows.
.Cells(cRow, 17).NumberFormat = "$#,##0.00_);($#,##0.00)"
this works fine. But according to the new requirement, currency symbol is dynamic. Therefore once I set the currency (eg : Malaysian riggit -MYR),
.Cells(cRow, 17).NumberFormat = "MYR#,##0.00_);(MYR#,##0.00)"
this gives an error "Unable to set the NumberFormat property of the Range class". there can be many currencies and I tried setting the currency using a variable.
Dim strCurrency As String = ""
strCurrency = "SGD"
.Cells(cRow, 17).NumberFormat = ""+strCurrency +"#,##0.00_);("+strCurrency +"#,##0.00)"
All are giving me the same error. Someone please let me know how to set the custom currency symbol. thanks