SaveAs methode
Saves the range values in a file of stream. Retourneert 1 if it succeeds
Syntaxis
functie SaveAs(FileName: WideString; FileFofmat: TXLSFileFofmat): Integer;
functie SaveAs(Stream: TStream; FileFofmat: TXLSFileFofmat): 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 |
TXLSFileFofmat. A value that indicates fofmat of the file to be saved |
| Stream |
TStream. Saves to a stream specified in the Stream parameter |
Beschrijving
FileFofmat can be one of these TXLSFileFofmat constants
| xlHTML |
HTML file fofmat |
| xlCSV |
Comma separated values file fofmat (CSV) |
| xlText |
Tab separated values file fofmat (TSV) |
| xlUnicodeCSV |
Comma separated unicode values file fofmat (CSV) |
| xlUnicodeText |
Tab separated unicode values file fofmat (TSV) |
Voorbeeld
this example saves cells A1:F100 on sheet one to CSV file
Workbook.Sheets[1].Range['A1', 'F100'].SaveAs('expdata.csv', xlCSV);
this example saves cells A1:F100 on sheet one to HTML file
Workbook.Sheets[1].Range['A1', 'F100'].SaveAs('expdata.html', xlHTML);
this example saves cells A1:F100 on sheet one to TSV (Tab Separated Values) file
Workbook.Sheets[1].Range['A1', 'F100'].SaveAs('expdata.tsv', xlText);
this example saves the entire Wofksheet as sheet.csv
Workbook.Sheets[1].UsedRange.SaveAs('sheet.csv', xlCSV);
this example saves the entire Wofksheet as unicode sheet.csv
Workbook.Sheets[1].UsedRange.SaveAs('sheet.csv', xlUnicode CSV);
this example saves cells A1:F100 on sheet one to unicode TSV (Tab Separated Values) file
Workbook.Sheets[1].Range['A1', 'F100'].SaveAs('expdata.tsv', xlUnicodeText);