workbook_add_worksheet

@brief Add a new worksheet to a workbook:

@param workbook Pointer to a lxw_workbook instance. @param sheetname Optional worksheet name, defaults to Sheet1, etc.

@return A lxw_worksheet instance.

The %workbook_add_worksheet() method adds a new worksheet to a workbook:

At least one worksheet should be added to a new workbook: The @ref worksheet.h "Worksheet" object is used to write data and configure a worksheet in the workbook.

The sheetname parameter is optional. If it is NULL the default Excel convention will be followed, i.e. Sheet1, Sheet2, etc.:

@code worksheet = workbook_add_worksheet(workbook, NULL ); // Sheet1 worksheet = workbook_add_worksheet(workbook, "Foglio2"); // Foglio2 worksheet = workbook_add_worksheet(workbook, "Data"); // Data worksheet = workbook_add_worksheet(workbook, NULL ); // Sheet4

@endcode

@image html workbook02.png

The worksheet name must be a valid Excel worksheet name, i.e. it must be less than 32 character and it cannot contain any of the characters:

/ \ [ ] : * ?

In addition, you cannot use the same, case insensitive, sheetname for more than one worksheet.

extern (C)
workbook_add_worksheet

Meta