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

Name is Gil
1 min readFeb 12, 2018

--

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!

--

--

Name is Gil
Name is Gil

Written by Name is Gil

Software Engineer, Filmmaker, Entrepreneur, Father

Responses (3)