Lägga till kalkylblad i ny Excel fil i Jython
Contents
[
Hide
]
Aspose.Cells - Lägga till kalkylblad i ny Excel
Att lägga till dokument med Aspose.Cells Java för Jython. Här kan du se exempelkod.
Jython Kod
from aspose-cells import Settings
from com.aspose.cells import Workbook
from com.aspose.cells import SaveFormat
class AddingWorksheetstoNewExcelFile:
def __init__(self):
dataDir = Settings.dataDir + 'WorkingWithWorksheets/AddingWorksheetstoNewExcelFile/'
workbook = Workbook(dataDir + "Book1.xls")
#Adding a new worksheet to the Workbook object
worksheets = workbook.getWorksheets()
sheetIndex = worksheets.add()
worksheet = worksheets.get(sheetIndex)
#Setting the name of the newly added worksheet
worksheet.setName("My Worksheet")
#Saving the Excel file
workbook.save(dataDir + "book.out.xls")
#Print Message
print "Sheet added successfully."
if __name__ == '__main__':
AddingWorksheetstoNewExcelFile()
Ladda ned körbar kod
Ladda ned Hämta dokument (Aspose.Cells) från någon av de sociala kodningsplatserna nedan: