A client wants to "Web-enable" a spreadsheet calculation -- the user to specify the values of certain cells, then show them the resulting values in other cells.
(They do NOT want to show the user a "spreadsheet-like" interface. This is not a UI question.)
They have a huge spreadsheet with lots of calculations over many, many sheets. But, in the end, only two things matter -- (1) you put numbers in a couple cells on one sheet, and (2) you get corresponding numbers off a couple cells in another sheet. The rest of it is a black box.
I want to present a UI to the user to enter the numbers they want, then I'd like to programatically open the Excel file, set the numbers, tell it to re-calc, and read the result out.
Is this possible/advisable? Is there a commercial component that makes this easier? Are their pitfalls I'm not considering?
(I know I can use Office Automation to do this, but I know it's not recommended to do that server-side, since it tries to run in the context of a user, etc.)
Edit: A lot of people are saying I need to recreate the formulas in code. However, this would be staggeringly complex. It sounds like this could be a solved problem -- does anyone know of a component of some type that would do it for me? Someone has to have created some "Excel-formula-to-code" generation system. I'd gladly pay for it.
Edit/Solution: SpreadsheetGear is what I was looking for. Among other things, it lets you use an XLS as a calculator. You can set the raw values of selected cells and then read out values of calculated cells. Exactly what I was looking for.