读取位于Sharepoint中的excel



我已经在Stackoverflow中搜索过了,发现了一些使用Interop.Excel的示例。

我正在使用Office 2016和Interop。Excel的目标是2013年。我想从我的c#应用程序中读取位于Sharepoint路径中的excel文件。用户将从应用程序更改单元格值,它应该在Sharepoint文件中得到更新。

我检查了几个ClosedXML的样本,但这些都是访问本地文件,而不是Sharepoint。

// Starting with ClientContext, the constructor requires a URL to the
// server running SharePoint.
ClientContext context = new ClientContext("https://{site_url}");
GroupCollection siteGroups = context.Web.SiteGroups;
// Assume that there is a "Members" group, and the ID=5.
Group membersGroup = siteGroups.GetById(5);
// Let's set up the new user info.
UserCreationInformation userCreationInfo = new UserCreationInformation();
userCreationInfo.Email = "user@domain.com";
userCreationInfo.LoginName = "domain\user";
userCreationInfo.Title = "Mr User";
// Let's add the user to the group.
User newUser = membersGroup.Users.Add(userCreationInfo);
context.ExecuteQuery();

我希望有一个示例代码帮助。

最新更新