Creates a new Worksheet. The new Worksheet becomes the active sheet.
Syntax
Before |
IXLSWorksheet Optional. An object that specifies the sheet before which the new sheet is added. |
After |
IXLSWorksheet Optional. An object that specifies the sheet after which the new sheet is added. The default value is the last Worksheet. |
Count |
Integer Optional. The number of sheets to be added. The default value is one. |
Type_ |
OleVariant Optional. Specifies the sheet type. Can be one of the following XlSheetType constants: xlWorksheet, xlChart, xlExcel4MacroSheet, or xlExcel4IntlMacroSheet. The default value is xlWorksheet. This argument is ignored by this library. |
Example
This example creates new Worksheet and sets the name to it.
Var Worksheet: IXLSWorksheet;
begin
Worksheet := Workbook.Sheets.Add;
Worksheet.Name := 'New sheet';
end;
This example creates new Worksheet after second Worksheet.