Aspose.Cells

//Creating an Workbook object with an Excel file path
Workbook workbook = new Workbook("data/xlsx4j/pivot.xlsm");

//Saving the Excel file
workbook.save("data/xlsx4j/pivot-rtt-Aspose.xlsm");

Xlsx4j

String inputfilepath  = "data/xlsx4j/pivot.xlsm";

boolean save = true;
String outputfilepath = "data/xlsx4j/pivot-rtt-xlsx4j.xlsm";

// Open a document from the file system
// 1. Load the Package
OpcPackage pkg = OpcPackage.load(new java.io.File(inputfilepath));

// Save it

if (save) {     
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save(outputfilepath);
}

Download Source Code

For More Examples, Please Visit Aspose Docs

Last edited Aug 25, 2014 at 6:32 AM by shoaibkhan, version 1