Workbook constructor

__init__(self)

Initializes a new instance of the Workbook class.


def __init__(self):
    ...

Remarks

The default file format type is Xlsx. If you want to create other types of files, please use Workbook(FileFormatType).

Example

The following code shows how to use the Workbook constructor to create and initialize a new instance of the class.

from aspose.cells import Workbook

workbook = Workbook()

__init__(self, file_format_type)

Initializes a new instance of the Workbook class.


def __init__(self, file_format_type):
    ...
ParameterTypeDescription
file_format_typeaspose.cells.FileFormatTypeThe new file format.

Remarks

The default file format type is Excel97To2003.

Example

The following code shows how to use the Workbook constructor to create and initialize a new instance of the class with various file format type.

from aspose.cells import FileFormatType, Workbook

workbook = Workbook(FileFormatType.XLSX)

__init__(self, file)

Initializes a new instance of the Workbook class and open a file.


def __init__(self, file):
    ...
ParameterTypeDescription
fileSystem.StringThe file name.

__init__(self, stream)

Initializes a new instance of the Workbook class and open a stream.


def __init__(self, stream):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe stream.

__init__(self, file, load_options)

Initializes a new instance of the Workbook class and open a file.


def __init__(self, file, load_options):
    ...
ParameterTypeDescription
fileSystem.StringThe file name.
load_optionsaspose.cells.LoadOptionsThe load options

__init__(self, stream, load_options)

Initializes a new instance of the Workbook class and open stream.


def __init__(self, stream, load_options):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe stream.
load_optionsaspose.cells.LoadOptionsThe load options

See Also