Saves the worksheet in a file or stream. Returns 1 if it succeeds.
function SaveAs(FileName: WideString; FileFormat: TXLSFileFormat): integer;
function SaveAs(Stream: TStream; FileFormat: TXLSFileFormat): integer;
| FileName | WideString. A string that indicates the name of the file to be saved. You can include a full path; if you don't, component saves the file in the current folder. |
| FileFormat | TXLSFileFormat. A value that indicates format of the file to be saved. |
| Stream | TStream. Saves to a stream specified in the Stream parameter. |
This example saves the worksheet one as CSV file
Workbook.Sheets[1].SaveAs('sheet.csv', xlCSV);
This example saves the worksheet one as RTF file
Workbook.Sheets[1].SaveAs('sheet.rtf', xlRTF);
This example saves the worksheet one as HTML file
Workbook.Sheets[1].SaveAs('sheet.htm', xlHTML);
This example saves the worksheet one as TSV file
Workbook.Sheets[1].SaveAs('sheet.tsv', xlText);
This example saves the worksheet one as unicode TSV file
Workbook.Sheets[1].SaveAs('sheet.tsv', xlUnicodeText);
This example saves the worksheet one as unicode CSV file
Workbook.Sheets[1].SaveAs('sheet.csv', xlUnicodeCSV);