Skip to content

Instantly share code, notes, and snippets.

@toinetoine
Created June 10, 2016 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toinetoine/13c0e8b5b4d419f700e621f3372bac59 to your computer and use it in GitHub Desktop.
Save toinetoine/13c0e8b5b4d419f700e621f3372bac59 to your computer and use it in GitHub Desktop.
Reading .NET worksheets without Koogra
Microsoft.Office.Interop.Excel._Application _app = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook workbook = _app.Workbooks.Open(filePath);
Microsoft.Office.Interop.Excel.Worksheet sheet = workbook.Sheets[sheetName] as Microsoft.Office.Interop.Excel.Worksheet;
Microsoft.Office.Interop.Excel.Range range = sheet.get_Range("A1:A1", System.Reflection.Missing.Value);
return range.Text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment