How to read excel file from SharePoint Document Library .NET/C#

Excel Interop provides a better way to read data inside an excel worksheet that’s located on your Sharepoint docs library. Using office 365 this will also work.

First you need to download the Interops assembly to do this you can download the SDK or better yet use Nuget Package.

(Copy)Install-package Microsoft.Office.Interop.Excel -Version 15.0.4795.1000

Once that’s done then you can build out your code like the following:

let me explain.

string url is the link to your shared document in SharePoint

Workbook class i the one need to open the excel document

Worksheet is explanatory

Range is where you put the value for your Columns.

And that’s it! Happy coding!