Hello Aspose team ,
We convert our excel file to docX then convert it into a doc file. After converting the excel file into docX, the “Reporting” is overlapped with “Benchmark” text
Lifestyle Management-docx.docx (170.4 KB)
Lifestyle Management Excel .xlsx.zip (73.9 KB)
Following is an executable code snippet:
Workbook workbook = new Workbook("/Users/nitesh.kc/Desktop/Lifestyle Management Excel.xlsx")
workbook.calculateFormula();
def counter = 0, remain =0
def except = "P_Display"
while (workbook.getWorksheets().getCount() != remain){
if (workbook.worksheets.get(counter)?.visible == false) {
workbook.worksheets.removeAt(counter)
} else if (except && workbook.worksheets.get(counter)?.name != except) {
workbook.worksheets.removeAt(counter)
} else {
counter++
remain++
}
}
workbook.save("/Users/nitesh.kc/Desktop/excel_after_remove_sheet1.xlsx")
workbook = new Workbook("/Users/nitesh.kc/Desktop/excel_after_remove_sheet1.xlsx")
ByteArrayOutputStream dstStream = new ByteArrayOutputStream();
workbook.save(dstStream, SaveFormat.DocX);
ByteArrayInputStream srcStream = new ByteArrayInputStream(dstStream.toByteArray());
Document tempDocument = new Document(srcStream)
tempDocument.save("/Users/nitesh.kc/Desktop/Lifestyle Management-docx.docx")
Please let us know if anything is missing or needed for more clarification.