Click or drag to resize
ExcelFileSave Method (String, SaveOptions)
Saves the spreadsheet to a file with the specified path.

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1033
Syntax
public void Save(
	string path,
	SaveOptions options
)

Parameters

path
Type: SystemString
The path to which to save the spreadsheet.
options
Type: GemBox.SpreadsheetSaveOptions
The saving options which can be used to define settings for save operation.
Examples

Following code demonstrates different ways of saving ExcelFile to specified file format.

// Saves the spreadsheet to a file with the specified path
ef.Save("Report.xlsx");

using (FileStream stream = new FileStream("Report.pdf", FileMode.Create))
{
    // Saves file to the stream
    ef.Save(stream, SaveOptions.PdfDefault);
}

// Saves the file using specified save options
ef.Save("Report.html", new HtmlSaveOptions
{
    SelectionType = SelectionType.EntireFile
});
See Also