IExcelFile
Summary
Represents an Excel File object.
- Methods
Structure
- class IExcelFile
- adjustCellsToContent()
Adjusts the size of the cells to their content.
- adjustColumnWidth(WorksheetName: str, Column: int32, width: float)
Adjusts the width of a specific column given the column's number.
- adjustColumnWidth(WorksheetName: str, Column: str, width: float)
Adjusts the width of a specific column given the column's name.
- adjustRowHeight(WorksheetName: str, Row: int32, height: float)
Adjust the height of a specific row.
- close()
Closes the file.
- containWorksheet(WorksheetName: str) bool
Checks if the excel file contains a specific worksheet or not given its name.
- deleteCellHyperlink(WorksheetName: str, cell: str)
Deletes a hyper link from a specific cell in a specific worksheet.
- deleteCellHyperlink(WorksheetName: str, Row: int32, Column: int32)
Deletes a hyper link from a specific cell in a specific worksheet.
- getCellValue(WorksheetName: str, cell: str) object
Gets the cell value of a specific cell in a specific worksheet given the cell's coordinates.
- getCellValue(WorksheetName: str, Row: int32, Column: int32) object
Gets the cell value of a specific cell in a specific worksheet given the cell's coordinates.
- getFirstFreeRow(WorksheetName: str) int32
Gets the number of the first free line of the table in a worksheet.
- getLineValues(WorksheetName: str, Row: int32) List[object]
Gets a list of the cells value of a specific line.
- insertCell(WorksheetName: str, cell: str, cellContent: str)
Inserts a cell in a specific worksheet.
- insertCell(WorksheetName: str, Row: int32, Column: int32, cellContent: str)
Inserts a cell in a specific worksheet.
- insertCell(WorksheetName: str, cell: str, cellContent: str, FontColor: str, BackgroundColor: str, WithBorders: bool)
Inserts a cell in a specific worksheet.
- Parameters
WorksheetName (
str
) – Desired worksheet name.cell (
str
) – The cell's coordinates.cellContent (
str
) – The cell's content (i.eA5
).FontColor (
str
) – The font color of the cell.BackgroundColor (
str
) – The background color of the cell0WithBorders (
bool
) –True
if borders are needed to be added,False
otherwise.
- insertCell(WorksheetName: str, Row: int32, Column: int32, cellContent: str, FontColor: str, BackgroundColor: str, WithBorders: bool)
Inserts a cell in a specific worksheet.
- Parameters
WorksheetName (
str
) – Desired worksheet name.Row (
int32
) – Row number of the cell.Column (
int32
) – Column number of the cell.cellContent (
str
) – The cell's content.FontColor (
str
) – The font color of the cell.BackgroundColor (
str
) – The background color of the cell.WithBorders (
bool
) –True
if borders are needed to be added,False
otherwise.
- insertCellRange(WorksheetName: str, firstCell: str, lastCell: str, cellContent: str)
Inserts a cell range in a specific worksheet.
- insertCellRange(WorksheetName: str, firstCell: str, lastCell: str, cellContent: str, FontColor: str, BackgroundColor: str, WithBorders: bool)
Inserts a cell range in a specific worksheet.
- Parameters
WorksheetName (
str
) – Desired worksheet name.firstCell (
str
) – Coordinates of the first cell in the range (i.eA5
).lastCell (
str
) – Coordinates of the last cell in the range (i.eD10
).cellContent (
str
) – Cells content.FontColor (
str
) – Font color of the cells.BackgroundColor (
str
) – Background color of the cells.WithBorders (
bool
) –True
if borders are needed to be added,False
otherwise.
- insertComment(WorksheetName: str, cell: str, comment: str)
Inserts a comment in a specific cell of a specific worksheet.
- insertComment(WorksheetName: str, Row: int32, Column: int32, comment: str)
Inserts a comment in a specific cell of a specific worksheet.
- insertLine(WorksheetName: str, listOfElements: object)
Inserts a line after the last row in the table of a specific sheet.
- insertLine(WorksheetName: str, listOfElements: object, RowNumber: int32)
Inserts a line at a specific row number in the table of a specific sheet.
- insertLine(WorksheetName: str, listOfElements: object, FontColor: str, BackgroundColor: str, WithBorders: bool)
Inserts a line after the last row in the table of a specific sheet.
- Parameters
WorksheetName (
str
) – Desired worksheet name.listOfElements (
object
) – The list of elements to be inserted in the row.FontColor (
str
) – The font color of the cells.BackgroundColor (
str
) – The background color of the cells.WithBorders (
bool
) –True
if borders are needed to be added,False
otherwise.
- insertLine(WorksheetName: str, listOfElements: object, FontColor: str, BackgroundColor: str, WithBorders: bool, RowNumber: int32)
Inserts a line at a specific row number in the table of a specific sheet.
- Parameters
WorksheetName (
str
) – Desired worksheet name.listOfElements (
object
) – The list of the elements to be inserted in a row.FontColor (
str
) – The font color of the cells.BackgroundColor (
str
) – The background color of the cells.WithBorders (
bool
) – The background color of the elements.RowNumber (
int32
) – The row number at which the line will be inserted.
- insertWorksheet(WorksheetName: str)
Inserts a new worksheet in the excel file.
- Parameters
WorksheetName (
str
) – Name of the worksheet.
- lockWorksheet(WorksheetName: str)
Locks a specific worksheet to prevent unwanted modification.
- Parameters
WorksheetName (
str
) – Worksheet name.
- lockWorksheet(WorksheetName: str, password: str)
Locks a specific worksheet to prevent unwanted modification with a protection password.
- modifyCellFormula(WorksheetName: str, cell: str, formula: str)
Modifies the formula of a specific cell to a specific formula in a specific worksheet.
- modifyCellHyperlinkInSameSheet(WorksheetName: str, cell: str, linkToAddressInSameWorksheet: str)
Modifies the hyper link of a specific cell to a specific hyper link in the same sheet in a specific worksheet.
- modifyCellHyperlinkInSameSheet(WorksheetName: str, Row: int32, Column: int32, linkToAddressInSameWorksheet: str)
Modifies the hyper link of a specific cell to a specific hyper link in the same sheet in a specific worksheet.
- modifyCellHyperlinkToFile(WorksheetName: str, cell: str, linkToOtherFile: str)
Modifies the hyper link of a specific cell to a specific hyper link of a file in a specific worksheet.
- modifyCellHyperlinkToFile(WorksheetName: str, Row: int32, Column: int32, linkToOtherFile: str)
Modifies the hyper link of a specific cell to a specific hyper link of a file in a specific worksheet.
- modifyCellHyperlinkToOtherSheet(WorksheetName: str, cell: str, worksheetOfLink: str, cellOfLink: str)
Modifies the hyper link of a specific cell to a specific hyper link to another sheet in a specific worksheet.
- modifyCellHyperlinkToOtherSheet(WorksheetName: str, Row: int32, Column: int32, worksheetOfLink: str, cellOfLink: str)
Modifies the hyper link of a specific cell to a specific hyper link to another sheet in a specific worksheet.
- modifyCellRangeFormula(WorksheetName: str, firstCell: str, lastCell: str, formula: str)
Modifies the formula of a specific range in a specific worksheet.
- save()
Saves the file.