Hi,
im trying to replace variables in a simple XSLX file (attached) but I'm getting a UnmarshalException. I'm using Word 2010 on Win 8.1. Please advise.
Code:
File inputFile = new File("C:/Temp/sample2.xlsx");
File outputFile = new File("C:/Temp/sample2_output.xlsx");
SpreadsheetMLPackage opcPackagepkg = SpreadsheetMLPackage.load(inputFile);
WorksheetPart sheet = (WorksheetPart) opcPackagepkg.getParts().get(new PartName("/xl/worksheets/sheet1.xml"));
HashMap<String, String> mappings = new HashMap<String, String>();
mappings.put("title1", "This is a title");
sheet.variableReplace(mappings);
opcPackagepkg.save(outputFile);
Log and stacktrace:
INFO org.xlsx4j.jaxb.Context - Using JAXB Reference Implementation ...