none
Will Office 365 API be suitable in allowing users to edit formulas in Excel, but run them as part of existing PHP code? RRS feed

  • Question

  • I am working with PHP code, and I have a block of code that is essentially arithmetic formulas, something like so:

    //initial values pulled in from MySQL database
    if ($gear == 2) { if ($shell % 2 == 0) { $stage1 = $stage2 = $shell / 2; } else { $stage1 = ($shell - 1) / 2; $stage2 = ($shell - 1) / 2 + 1; } $d61 = 3 + 4 * $stage1; } else { $stage1 = $shell; $stage2 = 0; $d61 = 2 + 3 * $stage1; }
    //output is collected and fed into other modules,
    //or is sent to the view, and is displayed on a web page

    The code is used by many internal PHP modules to do business critical computations.  It takes input and produces output and is used all the time, and it works fine. 

    The Change

    The change is that this code needs to be user-controlled, aka, be editable by the user who is not a programmer, but are proficient with Excel.  Currently user has to come to me and involve me to make any changes to the block of code.  There is a need to remove me being the middle man and let the user change the code directly somehow. 

    a.k.a: I want the user to become a programmer in their familiar domain of Excel but allow me to embed Excel code they produce into the existing PHP software that I maintain.

    I thought that Office 365 API or Excel API will be the answer.  But how?  I don't yet have complete understanding of how it works and I seek insight of someone who perhaps already worked with it to advise.

    Question

    What does it take to implement it and how does it work?  I am looking for a high-level view and fill in of details I may miss if I choose to go Excel API route.  For example:

    • Can I set up Excel API to fulfill my need?
    • Will that API be a web service or will it be local to the (Linux) server? 
    • Will a web-based service meet performance needs?  Say block may need to be executed 100 times per hour.  Will I have to depend on The Internet to do such computations over and over many times?
    • Will the user be able to edit their formulas in the Excel and publish them back to live PHP server?
    • Once everything is set up do I still have to be the middle man between the user and them changing the code somehow, such as update the repository or push their changes somehow?

    Main Question

    Essentially, will Office 365 API or some sort of Excel API be suitable for the described task? 

    Can you paint a picture of what it would look like once I get it working?  Will the user open up Excel and start hacking away?  When they "Save", does it automatically save to the server where PHP is running apps?  Do they have to "publish" their updates or do I have to help them with it? 


    • Edited by DennisMV Tuesday, August 9, 2016 2:30 PM polishing up the wording
    • Moved by Nan_Yu Wednesday, August 10, 2016 1:50 AM
    Tuesday, August 9, 2016 2:27 PM

Answers

  • Hi DennisMV,

    According to your description, the most basic Office Add-in consists of a static HTML page that is displayed inside an Office application, but doesn't interact with either the Office document or any other Internet resource. However, because it is a web application, you can use any technologies, both client and server side, that your hosting provider supports (such as ASP.net, PHP, or Node.js). To interact with Office clients and documents, you can use the office.js JavaScript API that we provide.

    For more information, please refer to links below:

    Office Add-ins platform overview

    JavaScript API for Office reference

    • Proposed as answer by David_JunFeng Thursday, August 18, 2016 1:32 PM
    • Marked as answer by David_JunFeng Thursday, August 18, 2016 1:32 PM
    Thursday, August 11, 2016 9:08 AM

All replies

  • Hi DennisMV,

    This is the forum to discuss questions and feedback for Office 365 for Developers. I'll move your question to the MSDN forum for office 2013 app development :

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=appsforoffice  

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. 

    Thanks for your understanding.

    Best Regards,
    Nan Yu
    • Edited by Nan_Yu Wednesday, August 10, 2016 1:53 AM
    Wednesday, August 10, 2016 1:50 AM
  • Hi DennisMV,

    According to your description, the most basic Office Add-in consists of a static HTML page that is displayed inside an Office application, but doesn't interact with either the Office document or any other Internet resource. However, because it is a web application, you can use any technologies, both client and server side, that your hosting provider supports (such as ASP.net, PHP, or Node.js). To interact with Office clients and documents, you can use the office.js JavaScript API that we provide.

    For more information, please refer to links below:

    Office Add-ins platform overview

    JavaScript API for Office reference

    • Proposed as answer by David_JunFeng Thursday, August 18, 2016 1:32 PM
    • Marked as answer by David_JunFeng Thursday, August 18, 2016 1:32 PM
    Thursday, August 11, 2016 9:08 AM