Web service for an Excel automation script on Windows


I am tasked to develop a very simple web layer for a very complex algorithm that is implemented as an Excel worksheet. This script would be called from a Ruby on Rails app that would be presenting the user with the forms, check validations and whatnot, and should return just a number. After perusing this site, my best shot is to automate Excel using Python or Ruby under Windows and run the algorithm there --we are a Ruby shop, but I've found more info for Python.

I think I can write a Python script to run the calculation in a day, but now the final question remains: how do we put a web layer on top of the core script? We are familiar with Apache, so installing Python as a Apache module is my straight thought, but we could also install Twisted and try to run the web server itself in Python.

What would be your choices?

By : pantulis


My first choice would be to move the calculations that are in the Excel workbook into my Ruby application code. While it will likely take some additional work, my guess is that it will take less time to port the Excel app to Ruby than introducing layers of complexity on top of Excel. Additionally, calling into Excel, passing user submitted data, opens up additional possible security holes.

My second choice would be to do it the language you know best. It looks like Ruby can interact with Excel using win32ole (another example).

This video can help you solving your question :)
By: admin