Using Excel spreadsheets with macros in backend of web application

3k views Asked by At

I have an architectural nightmare lying before me and want to clear some details.

So, the question is as follows:

How can someone build a web application which uses some macros buried deep in the Excel spreadsheet as a back-end for computations?

The background: My client has an Excel spreadsheet doing some calculation for him (so it's in some ways an Excel application). Now he is willing to have a WEB app using the same Excel spreadsheet as a back-end. Yep, it's as said: to have a web front-end doing queries to the macros in this Excel spreadsheet and getting calculated data back. No, I cannot look at the macros source and translate it to my target language, because the spreadsheet is password-protected from editing.

The main web server which better be left untouched is Apache. The target development language I most proficient with is PHP.

I have read the Microsoft Support article about Excel<->VB interoperability and question here about the Excel<->C# interoperability and concluded that the task is possible with the next dataflow:

Apache -> Some C#.NET / VB.NET app in backend as a relay -> my Excel spreadsheet -> back to relay -> Apache

but of course I think it's just horrible and I want some more sensible solution.

1

There are 1 answers

3
Charles Williams On BEST ANSWER

If the macros buried in the spreadsheet are VBA there is no clean way (AFAIK) of running the spreadsheet on a server.
There are some tools available that claim to be able to compile an excel spreadsheet including VBA into an executable that you could run on a server, but I have no experience of them so do not know which, if any, would suit your situation.