Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created March 18, 2021 01:41
Show Gist options
  • Save aspose-com-gists/d82ed23b0482cd74579351e65db5d1c2 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/d82ed23b0482cd74579351e65db5d1c2 to your computer and use it in GitHub Desktop.
Excel XLSX to Word DOCX in Java
// Instantiate a Workbook object by Excel file's path
Workbook workbook = new Workbook("workbook.xlsx");
// Create DOCX save options
DocxSaveOptions options = new DocxSaveOptions();
options.setClearData(true);
options.setCreateDirectory(true);
options.setCachedFileFolder("cache");
options.setMergeAreas(true);
// Save as DOCX
workbook.save("Book1.docx", options);
// Instantiate a Workbook object by Excel file's path
Workbook workbook = new Workbook("workbook.xlsx");
// Save as DOCX
workbook.save("Book1.docx", SaveFormat.DOCX);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment