NativeExcel suite v2.x

Save method

Saves changes to the workbook. Returns 1 if it succeeds.

Syntax

function Save: integer;

Example

This example creates a new workbook with one worksheet and then saves the workbook.
Var
  WorkBook: IXLSWorkBook;
begin
  WorkBook := TXLSWorkBook.Create; {create new workbook}
  WorkBook.Worksheets.Add; 
  WorkBook.SaveAs('book.xls');
  WorkBook.Sheets[1].Name := 'NewName';
  WorkBook.Save; //save to book.xls
end;
This example opens book.xls, changes the name of sheet one and then saves the workbook to the same file.
Var
  WorkBook: IXLSWorkBook;
begin
  WorkBook := TXLSWorkBook.Create; 
  WorkBook.Open('book.xls');
  WorkBook.Sheets[1].Name := 'NewName';
  WorkBook.Save; //save to book.xls
end;
Copyright © NikaSoft 2004-2011