Saving Files in Python

Aspose.Cells - Saving Files

Saving file to some location

If developers need to save their files using Aspose.Cells Java for Python to some storage location then they can simply specify the file name (with its complete storage path) and desired file format (using the FileFormatType enumeration) while calling the save method of Workbook object.

Python Code

 fileFormatType = self.FileFormatType


#Creating an Workbook object with an Excel file path

workbook = self.Workbook(self.dataDir + "Book1.xls")

#Save in default (Excel2003) format

workbook.save(self.dataDir + "book.default.out.xls")

#Save in Excel2003 format

workbook.save(self.dataDir + "book.out.xls", fileFormatType.EXCEL_97_TO_2003)

#Save in Excel2007 xlsx format

workbook.save(self.dataDir + "book.out.xlsx", fileFormatType.XLSX)

#Save in SpreadsheetML format

workbook.save(self.dataDir + "book.out.xml", fileFormatType.EXCEL_2003_XML)

#Print Message

print("<BR>")

print("Worksheets are saved successfully.")

Download Saving File (Aspose.Cells) from any of the below mentioned social coding sites: