有没有办法以编程方式编辑 Office 365 Excel 文档?
Is there a way to programatically edit Office 365 Excel documents?
我必须更新如下所示的电子表格。
一点也不难。我只是转到最后一行并在相应的列中输入我需要的内容。我想自动化这个。我尝试的第一件事是 Selenium Webdriver,但结果太慢而且碰运气。接下来我检查的是 API 但 it looks like 没有 Excel.
我可以使用 Selenium 下载文件,然后使用 C# 应用程序将其修改为 excel 文件,然后重新上传。不过此时我想知道 Google Docs 是否有更简单的解决方案。
那么有什么方法可以编程修改 excel 在线电子表格吗?
我知道有 4 个选项可以通过 JavaScript 或 REST 以编程方式在线修改 Excel:
- Office 加载项平台:https://dev.office.com/docs/add-ins/overview/office-add-ins
- Excel 服务 JavaScript API - EWA Excel Web 访问命名空间(几年未更新):https://msdn.microsoft.com/en-us/library/hh315812(v=office.14).aspx
- Excel 服务 REST API(通过 SharePoint Online):https://msdn.microsoft.com/en-us/library/ee556842(v=office.14).aspx
- Microsoft Graph REST API(Excel 对象目前处于测试阶段):https://graph.microsoft.io/en-us/docs/api-reference/beta/resources/excel
我不知道什么时候可以,但现在 you can add rows to tables and is quite easy to test on the graph explorer。
请记住,首先您需要设置一个 table via api or in the document。
来自文档:
Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call.
我必须更新如下所示的电子表格。
一点也不难。我只是转到最后一行并在相应的列中输入我需要的内容。我想自动化这个。我尝试的第一件事是 Selenium Webdriver,但结果太慢而且碰运气。接下来我检查的是 API 但 it looks like 没有 Excel.
我可以使用 Selenium 下载文件,然后使用 C# 应用程序将其修改为 excel 文件,然后重新上传。不过此时我想知道 Google Docs 是否有更简单的解决方案。
那么有什么方法可以编程修改 excel 在线电子表格吗?
我知道有 4 个选项可以通过 JavaScript 或 REST 以编程方式在线修改 Excel:
- Office 加载项平台:https://dev.office.com/docs/add-ins/overview/office-add-ins
- Excel 服务 JavaScript API - EWA Excel Web 访问命名空间(几年未更新):https://msdn.microsoft.com/en-us/library/hh315812(v=office.14).aspx
- Excel 服务 REST API(通过 SharePoint Online):https://msdn.microsoft.com/en-us/library/ee556842(v=office.14).aspx
- Microsoft Graph REST API(Excel 对象目前处于测试阶段):https://graph.microsoft.io/en-us/docs/api-reference/beta/resources/excel
我不知道什么时候可以,但现在 you can add rows to tables and is quite easy to test on the graph explorer。
请记住,首先您需要设置一个 table via api or in the document。
来自文档:
Adds rows to the end of the table. Note that the API can accept multiple rows data using this API. Adding one row at a time could lead to performance degradation. The recommended approach would be to batch the rows together in a single call rather than doing single row insertion. For best results, collect the rows to be inserted on the application side and perform single rows add operation. Experiment with the number of rows to determine the ideal number of rows to use in single API call.