Aspose Cells unable to add pound sign

Hi

You recently released a version of Aspose Cells (4.5.0.22) to me to fix an issue, however it has made me unable to put pound signs in to cells properly, and will replace the pound sign with a question mark.

Is there anything I can get to correct this?

Many thanks

Hi,

I don't have any problem to format a cell value with pound currency sign. I tried the following code and it works fine attached is the output file.

Sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells[0, 0].PutValue(1234);
Aspose.Cells.Style style = worksheet.Cells[0, 0].GetStyle();
style.Custom = "[$£-809]#,##0;-[$£-809]#,##0";
worksheet.Cells[0, 0].SetStyle(style);
workbook.Save("f:\\test\\out_currbook.xls");

Could you give us your sample code with template file, we will check it soon.

Thank you.

Thanks for that, however it is actually needed as part of a string, rather than a currency. Modifying your code as below still gives me a question mark instead of a pound sign.

Workbook workbook = new Workbook();

Worksheet worksheet = workbook.Worksheets[0];

worksheet.Cells[0, 0].PutValue("This is a string (£)");

Aspose.Cells.Style style = worksheet.Cells[0, 0].GetStyle();

style.Custom = "[$£-809]#,##0;-[$£-809]#,##0";

worksheet.Cells[0, 0].SetStyle(style);

workbook.Save("c:\\out_currbook.xls");

Oddly saving it to Excel 2007 format works fine through the office converter, and if I use the string

"This is a string ($ £ €)" I get a pound sign in the middle

Any ideas?

Many thanks

Hi,

Well, I don't find any problem with the pound sign, the sign is displayed fine in the cell when opening the file into MS Excel. I am not sure but the problem might be some charset type on your machine.

Following is my sample code and attached is the resultant file:

Sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells[0, 0].PutValue("This is a string (£)");
workbook.Save("c:\\out_currbook.xls");

By the way which version of Aspose.Cells you are using? I am using latest fix (4.5.0.31).

Could you also post your created excel file here. We will also try to figure out your issue.

Thank you.

Hi

Please find attached the Excel file we generate. We are using 4.5.0.22, but we tried 4.5.0.00 and it works fine. Could you send me your latest version and I will try that

Many thanks

Hi,

Sure, the latest fix (4.5.0.31) is attached for you, kindly try it if it works fine.

Thank you.

That version works fine now. Thanks very much for your help