Note: This article was originally published in 2008. Some steps, commands, or software versions may have changed. Check the current General documentation for the latest information.

Here is a summary of the Steps obtained from Microsoft’s MSDN:

 

  1. Creating a Windows Console Application project in Visual Studio 2005.

  2. Adding a reference to the Excel 12.0 Object Library to the project. This marks the project as making use of the Excel 12.0 Object Library.

  3. Importing the Microsoft.Office.Interop.Excel  namespace. This allows the code to use the classes and types exposed as part of the**Microsoft.Office.Interop.Excel  **namespace without having to specify the fully qualified namespace path.

  4. Creating a data insertion helper method. This method makes it easier to insert data for the table into the worksheet.

  5. Declaring helper variables to hold references to the Excel objects used in the calculated column creation code.

  6. Creating an instance of the Excel ApplicationClass  object. This is the top-most class in the Excel object model hierarchy and is the starting point for working with the other classes in the object model.

  7. Creating a workbook and adding a worksheet to it. The code shows how to create a workbook with a single worksheet in it.

  8. Inserting table data into the worksheet. The sample code shows how to call the data insertion helper method to add the data for the table to the worksheet.

  9. Implementing the table and calculated column creation code. The sample code adds a table to the worksheet. It illustrates how to use theWorksheet.ListObjects.Add  method to add a table to the worksheet and how to add a formula to a cell, causing the formula to be automatically extended to the other rows in the column.

  10. Saving the workbook, exiting Excel, and releasing the references to its COM objects so that Excel can unload from memory.

 

Obtained from: http://msdn.microsoft.com/en-us/library/bb491102.aspx