Free Support Forum -

getStringValue() throws exception with Euro Currency Cellformat


Using Aspose cells for Java version, I’m getting a problem when reading a spreadsheet with Euro values. The problem can be reproduced with the following code and the attached file.


import com.aspose.cells.Cells;
import com.aspose.cells.CellsHelper;
import com.aspose.cells.Workbook;

public class AsposeTestFormatError
public static void main(String[] args) throws FileNotFoundException, Exception
new AsposeTestFormatError().run();
public void run() throws FileNotFoundException, Exception{
System.out.println("Using Aspose version "+CellsHelper.getVersion());
Workbook wb=new Workbook(new FileInputStream(“C:\Aspose euro test.xls”));
String s = wb.getWorksheets().get(0).getCells().get(0, 0).getStringValue();

The output is:
Using Aspose version
Exception in thread “main” java.lang.IllegalArgumentException: Malformed pattern “#,##0.00’ '€40”
at java.text.DecimalFormat.applyPattern(Unknown Source)
at java.text.DecimalFormat.(Unknown Source)
at com.aspose.cells.Cell.getStringValue(Unknown Source)
at com.du.sjk.scrap.AsposeTestFormatError.main(

This only seems to happen with Euro (France) but I haven’t tested all formats.

Thanks in advance for your help in this matter,

Simon Kelly
Agentrics LLC


I have tested your issue with latest version/fix i.e. v7.0.1.6: Please download: Aspose.Cells for Java v7.0.1.6
It works fine.

Please try it and let us know if it works fine.

Thank you.

Yes I can confirm this latest version has fixed the issue. Thanks!