ComponentOne Excel for .NET
Quick Start / 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.

    To write code in Visual Basic

    Visual Basic
    Copy Code

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

    To write code in C#

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

    Run the program and observe:


    Formatted content is added to the workbook.

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