Thursday, January 22, 2015

C# Excel PIA setup

Referring to the Excel PIA

  1. In the Solution Explorer, refer to the Excel Primary Interop Assembly (PIA) by clicking the project file
  2. Click the "Add Reference" menu option
  3. In the Add Reference dialog, click in the .NET tab and find Microsoft.Office.Interop.Excel.14.0.0.0 and click Ok

Define an Alias for the Excel PIA Namespace

using Excel=Microsoft.Office.Interop.Excel;

Declare and instantiate an Excel application object

Excel.Application objExcel=new Excel.Application();

No comments: