Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
With Aspose.Cells, it is possible to set the height of a single row in Python by calling the Cells collection’s setRowHeight method. The setRowHeight method takes the folloing parameters:
Python Code
def set_row_height(self):
\# Instantiating a Workbook object by excel file path
workbook = self.Workbook(self.self.dataDir + 'Book1.xls')
\# Accessing the first worksheet in the Excel file
worksheet = workbook.getWorksheets().get(0)
cells = worksheet.getCells()
\# Setting the height of the second row to 13
cells.setRowHeight(1, 13)
\# Saving the modified Excel file in default (that is Excel 2003) format
workbook.save(self.dataDir + "Set Row Height.xls")
print "Set Row Height Successfully." Set the width of a column by calling the Cells collection’s setColumnWidth method. The setColumnWidth method takes the following parameters:
Python Code
def set_column_width(self):
\# Instantiating a Workbook object by excel file path
workbook = self.Workbook(self.dataDir + 'Book1.xls')
\# Accessing the first worksheet in the Excel file
worksheet = workbook.getWorksheets().get(0)
cells = worksheet.getCells()
\# Setting the width of the second column to 17.5
cells.setColumnWidth(1, 17.5)
\# Saving the modified Excel file in default (that is Excel 2003) format
workbook.save(self.dataDir + "Set Column Width.xls")
print "Set Column Width Successfully." Download Adjusting Row Height and Column Width (Aspose.Cells) from any of the below mentioned social coding sites:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.