Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FileFormat Property
Collapse the table of content
Expand the table of content

Workbook.FileFormat Property

Gets the file format and type of the workbook.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in microsoft.office.tools.excel.dll)

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);

© 2015 Microsoft