using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Docs.Excel; namespace Export { public partial class Form1 : Form { public Form1() { InitializeComponent(); //Read a .xls file. ExcelWorkbook Wbook = ExcelWorkbook.ReadXLSX(@"..\..\..\Template.xlsx"); //Write worksheet to dataGridView. dataGridView1.DataSource = Wbook.Worksheets[0].WriteToDataTable(); } } }