user1477388
user1477388

Reputation: 21430

How to parse a complex Excel document with LINQ

I know how to parse Excel documents as per Read Excel using LINQ however the following document presents a greater challenge. It seems this would be very difficult to parse. Can anyone provide any "best practice" advice in approaching the following (?):

Upvotes: 0

Views: 928

Answers (2)

user1477388
user1477388

Reputation: 21430

I used http://excelpackage.codeplex.com/ which as worked quite well.

Upvotes: 0

Marcus Haßmann
Marcus Haßmann

Reputation: 118

I use VSTO for (fast!) reading whole Excel sheets. The result of the following piece of code is a two dimensional array:

using Microsoft.Office.Interop.Excel;
...
var rowCount = excelSheet.UsedRange.Rows.Count;
var columnCount = excelSheet.UsedRange.Columns.Count;
var range = excelSheet.Range["A1", Type.Missing];
range = range.Resize[rowCount, columnCount];
return (Object[,])range.Value2;

Upvotes: 1

Related Questions