This documentation is archived and is not being maintained.

Workbook.FileFormat Property

Gets the file format and type of the workbook.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in

public virtual XlFileFormat FileFormat { get; }

Property Value

One of the XlFileFormat values.

The following code example checks the value of the FileFormat property to determine whether the workbook is a normal workbook. If the workbook is a normal workbook, then the example calls the SaveAs method to resave the workbook as an XML spreadsheet with the name XMLCopy.xls in the path specified by the Path property.

private void WorkbookSaveAs()
    if (this.FileFormat == Excel.XlFileFormat.xlWorkbookNormal)
        this.SaveAs(this.Path + @"\XMLCopy.xls",
            Excel.XlFileFormat.xlXMLSpreadsheet, missing, missing,
            false, false, Excel.XlSaveAsAccessMode.xlNoChange,
            missing, missing, missing, missing, missing);