Excel for WPF | ComponentOne
QuickStart: Excel for WPF / Step 4 of 4: Saving and Opening the XLS File
In This Topic
    Step 4 of 4: Saving and Opening the XLS File
    In This Topic

    Finally, add the following code to save and load the Excel workbook. This code should be added after the code from Step 3 of 4 within the Form_Load event.

    Visual Basic
    Copy Code
    C1XLBook1.Save("c:\mybook.xls")
    System.Diagnostics.Process.Start("C:\mybook.xls")
    

     

    C#
    Copy Code
    c1XLBook1.Save(@"c:\mybook.xls");
    System.Diagnostics.Process.Start(@"c:\mybook.xls");
    

    Run the program and observe:

     

    Excel File

    Formatted content is added to the workbook.

    Congratulations! You've completed the Excel for WPF quick start.