Sheets¶
- class Sheets(impl: Any)¶
A collection of all
sheetobjects:>>> import xlwings as xw >>> xw.sheets # active book Sheets([<Sheet [Book1]Sheet1>, <Sheet [Book1]Sheet2>]) >>> xw.Book('Book1').sheets # specific book Sheets([<Sheet [Book1]Sheet1>, <Sheet [Book1]Sheet2>])
Added in version 0.9.0.
- add(name: str | None = None, before: Sheet | None = None, after: Sheet | None = None) Sheet¶
Creates a new Sheet and makes it the active sheet.
Parameters¶
- namestr, default None
Name of the new sheet. If None, will default to Excel’s default name.
- beforeSheet, default None
An object that specifies the sheet before which the new sheet is added.
- afterSheet, default None
An object that specifies the sheet after which the new sheet is added.
Returns¶
- sheetSheet
Added sheet object