Is it possible to read/store/retrieve data from Excel spreadsheet from Share point site to WPF application?

Lakshmanan B 81 Reputation points
2024-08-20T15:12:24.4533333+00:00

Hi,

I have connected to Share Point site referring the following blog: https://www.c-sharpcorner.com/article/sharepoint-csom-for-net-standard/

I have created a sample test spreadsheet in the Documents Library named *testSpreadSheet.xlsx
*
I have a quite a few columns in it say: Employee.No, Name, Age, Designation, Department.

Is it possible to retrieve a record like if I provide name of an employee in the C# code and read that record?

Also, If name of the employee is provided, Get the Designation of the employee?

I know, this is easier with Share Point List or SQL database, but I have a requirement where I wanted to read data from Excel spreadsheet that is stored in Share point. Any blog or documentation would be helpful!

Thanks in Advance!

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,918 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,961 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,008 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,043 questions
{count} votes

Accepted answer
  1. Asha Kanta Sharma 456 Reputation points
    2024-08-20T16:21:35.72+00:00

    Yes, it is possible to read, store, and retrieve data from an Excel spreadsheet stored in a SharePoint site within a WPF application. Use the SharePoint Client Object Model to authenticate and download the file into a stream. Use EPPlus or another library to open the Excel file and retrieve the data.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,171 Reputation points Microsoft Vendor
    2024-08-21T06:05:43.0266667+00:00

    Hi @Lakshmanan B,

    Per my research, there is no such function to read excel data in SharePoint by CSOM currently. AS a workaround, I would recommend you to use Graph api. You could refer to the following api

    https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/
    https://graph.microsoft.com/v1.0/me/drive/root:/{item-path}:/workbook/
    

    Here is the document for reference

    https://learn.microsoft.com/en-us/graph/api/resources/excel?view=graph-rest-1.0


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.