Workbook constructor

init

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

Initializes a new instance of the Workbook class.

def __init__(self, file_format_type):
    ...
ParameterTypeDescription
file_format_typeFileFormatTypeThe 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

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

def __init__(self, file):
    ...
ParameterTypeDescription
filestrThe file name.

init

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

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

init

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

def __init__(self, file, load_options):
    ...
ParameterTypeDescription
filestrThe file name.
load_optionsLoadOptionsThe load options

init

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

def __init__(self, stream, load_options):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe stream.
load_optionsLoadOptionsThe load options

See Also