FlexGrid for WinForms | ComponentOne
C1.Win.FlexGrid Namespace / Extensions Class / SaveExcel Method / SaveExcel(C1FlexGridBase,String,String,FileFlags) Method
C1FlexGridBase instance that will be saved.
Name of the file to save, including the path.
Name of the sheet to add to the Excel workbook.
Options to use when saving the file.

In This Topic
    SaveExcel(C1FlexGridBase,String,String,FileFlags) Method
    In This Topic
    Saves the grid contents to a Microsoft Excel (.XLS) file.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Sub SaveExcel( _
       ByVal grid As C1FlexGridBase, _
       ByVal fileName As String, _
       ByVal sheetName As String, _
       ByVal flags As FileFlags _
    ) 
    public static void SaveExcel( 
       C1FlexGridBase grid,
       string fileName,
       string sheetName,
       FileFlags flags
    )

    Parameters

    grid
    C1FlexGridBase instance that will be saved.
    fileName
    Name of the file to save, including the path.
    sheetName
    Name of the sheet to add to the Excel workbook.
    flags
    Options to use when saving the file.
    Remarks

    If the specified file exists, the control will add or replace a single worksheet in it. Existing sheets will be preserved if possible.

    The worksheet to add or replace is identified by the sheetName parameter.

    If the specified file is in use by another application (usually Excel), the method will fail.

    This method does not require Microsoft Excel to be installed on the machine.

    See Also