To read an Excel file using C#, you need to use the Excel object model. Here is a sample project that does this; I'm sure there are many other samples available online as well:
To create a Windows Forms application that uses the NodeXLControl to display a graph, do the following:
1. In Visual Studio 2008, select File, New, Project, Visual C#, Windows, Windows Forms Application.
2. While in the designer, open View, Toolbox and drag an ElementHost onto Form1. ElementHost is under "WPF Interoperability."
3. In the Form1 properties window, add a Load event handler to Form1. Call it "Form1_Load".
4. Overwrite the project's Form1.cs file with the sample code listed under the "Using NodeXLControl in Windows Forms Applications" section of the NodeXLControl topic in the NodeXLApi.chm help file.
5. In Visual Studio, select Project, Add Reference, Browse, and add references to Microsoft.NodeXL.Visualization.Wpf.dll, Microsoft.NodeXL.Wpf.Control.dll, and Microsoft.NodeXL.Core.dll.
Compile and run the application. You will see a NodeXL graph within the ElementHost.