Skip to content

SaveAs.cs

Avrigeanu Laurian edited this page Apr 12, 2023 · 1 revision

SaveAs(string, XlFileFormat)

Parameters

  • filePath (string): The full file path to save the Excel file to.
  • format (XlFileFormat): The format of the Excel file to be saved.

Returns

  • string: A message confirming that the Excel file has been saved to the specified location with the specified format.

Remarks

  • This method saves the current workbook as an Excel file with the specified format to the specified file path.
  • The XlFileFormat enumeration contains values that represent the file formats that Excel can save to, such as xlOpenXMLWorkbook for .xlsx format or xlExcel12 for .xlsb format.
  • If the file specified by filePath already exists, it will be overwritten.
  • If the file format specified by format is not compatible with the current workbook, an exception will be thrown.
Clone this wiki locally