locked
Excel Services Workbook Programmatic Update RRS feed

  • Question

  • Hello,

    I have successfully placed an excel 2010 workbook in the site settings document library and displayed it using the

    excel web access web part in Sharepoint 2013.  I also have created a web api using visual studio 2013 that can update worksheets in the workbook programmatically.     I used methods in the Microsoft.Office.Interop.Excel namespace. As a result, when the user refreshes their Sharepoint page, updates are seen.  When I attempt to deploy the web api to an IIS 7 web server running Windows Server 2008 R2, I get the error:

    {00024500-0000-0000-C000-000000000046} Retrieving the COM class factory for component with CLSID failed due to the following error 80040154 Class not registered Exception from HRESULT 0x80040154 REGDB_E_CLASSNOTREG.

    I have not been able to register the dll successfully or install the Office 2012 Primary Interop Assemblies as it seems to run the installer and do nothing.  I can install Office on the server if that would be best, but thought there would be a way to just install the libraries required.

    I have not found another way to update a spreadsheet programmatically that appears to be supported but I don’t know how best to build/deploy this solution.

    Thanks in advance!

    Thursday, October 29, 2015 6:04 PM

Answers

  • Hi,

    If you want to update excel data from the SharePoint document library, we can use the Excel Services REST API to achieve it.

    Example set a cell and return it:

    http://<ServerName>/_vti_bin/ExcelRest.aspx/Docs/Documents/sampleWorkbook.xlsx/model/Ranges('Sheet1!A1|G5')?Ranges('Sheet1!C3')=demo

    The following articles for your reference:

    Excel Services REST API Overview

    https://msdn.microsoft.com/en-us/library/ee556842.aspx

    Sample URI For Excel Services REST API

    https://msdn.microsoft.com/en-us/library/ee556820.aspx

    Best Regards,

    Dennis Guo


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Patrick_Liang Thursday, November 5, 2015 5:44 AM
    • Marked as answer by Patrick_Liang Monday, November 9, 2015 1:33 AM
    Friday, October 30, 2015 7:29 AM

All replies

  • I am investigating OpenXML as a means of accomplishing this on the server.  Please advise, thanks.
    Thursday, October 29, 2015 7:13 PM
  • Hi,

    If you want to update excel data from the SharePoint document library, we can use the Excel Services REST API to achieve it.

    Example set a cell and return it:

    http://<ServerName>/_vti_bin/ExcelRest.aspx/Docs/Documents/sampleWorkbook.xlsx/model/Ranges('Sheet1!A1|G5')?Ranges('Sheet1!C3')=demo

    The following articles for your reference:

    Excel Services REST API Overview

    https://msdn.microsoft.com/en-us/library/ee556842.aspx

    Sample URI For Excel Services REST API

    https://msdn.microsoft.com/en-us/library/ee556820.aspx

    Best Regards,

    Dennis Guo


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Patrick_Liang Thursday, November 5, 2015 5:44 AM
    • Marked as answer by Patrick_Liang Monday, November 9, 2015 1:33 AM
    Friday, October 30, 2015 7:29 AM