]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/ExcelImport.java
SCL API for direct access to SpreadsheetBooks
[simantics/platform.git] / bundles / org.simantics.spreadsheet.graph / src / org / simantics / spreadsheet / graph / ExcelImport.java
index 24a0a85d0ce15c204e14da3eb7b9ddef85daba48..a8bb342b33a2e8cb8fb5e796c365bbbc4b12be97 100644 (file)
@@ -224,8 +224,12 @@ public class ExcelImport {
                                         } else if(Cell.CELL_TYPE_STRING == val.getCellType()) {
                                             graph.claimLiteral(cell, SR.Cell_content, SR.Cell_content_Inverse, L0.Variant, Variant.ofInstance(val.toString()), Bindings.VARIANT);
                                         } else if(Cell.CELL_TYPE_NUMERIC == val.getCellType()) {
-                                            Double value = Double.parseDouble(val.toString());
-                                            graph.claimLiteral(cell, SR.Cell_content, SR.Cell_content_Inverse, L0.Variant, Variant.ofInstance(value), Bindings.VARIANT);
+                                            try {
+                                                Double value = Double.parseDouble(val.toString());
+                                                graph.claimLiteral(cell, SR.Cell_content, SR.Cell_content_Inverse, L0.Variant, Variant.ofInstance(value), Bindings.VARIANT);
+                                            } catch (Exception e) {
+                                                graph.claimLiteral(cell, SR.Cell_content, SR.Cell_content_Inverse, L0.Variant, Variant.ofInstance(val.toString()), Bindings.VARIANT);
+                                            }
                                         } else {
                                             graph.claimLiteral(cell, SR.Cell_content, SR.Cell_content_Inverse, L0.Variant, Variant.ofInstance(val.toString()), Bindings.VARIANT);
                                             System.err.println("Unprocessed cell type " + val.getCellType() + ", SheetName: " + sheetName + ", Row: " + rowN + ", Col:" + i);