N
N
nOXXXXX842019-10-04 06:51:49
ASP.NET
nOXXXXX84, 2019-10-04 06:51:49

How to create a site that will be based on Excel with macros stored on a server (ASP?)?

Good afternoon!
There is a 20 mega excel file with thousands of formulas and simple macros.
On the first page, we enter dozens of variables, the macro launch button is pressed, calculations / simulations take place on the other page, and the result (also dozens of indicators) is displayed on the third page.
Task: to create a website with a personal account, where the user could do all this. Those. select variables, press the button, wait and get the result on the screen.
They advised windows.server, asp, etc. But I don't understand any of this. An ambitious startup is looking for its programmer.
I omit the design component - there will be technology, it will be possible to bring beauty.
Please do not offer translation of all formulas into frame. The formulas are long and there are a huge number of them. Change/update regularly. This is a business simulation.
Many thanks in advance for your reply!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-10-04
@nOXXXXX84

you need to use a COM object called "Excel.Application"
There you already open a file, execute a macro, read / write cell values.
Either in C#

using Excel = Microsoft.Office.Interop.Excel;
Excel.Application xlApp = new Excel.Application();
Excel.Workbook xlWorkBook = xlApp.Workbooks.Open("E:\\book1.xlsm");
//тут манипуляции с xlWorkBook и ячейками
xlApp.Run("ShowMsg", "Hello from C# Client", "Demo to run Excel macros from C#");
//тут манипуляции с xlWorkBook и ячейками
xlWorkBook.Close(false);
xlApp.Quit();

In any case, the code is approximately the same, since it essentially uses the same MSOffice library: data and their recalculation in the context of the book, macros in the context of the application.

E
Eugene Kuznetsov, 2019-10-11
@KEugene

Sorry, but in the form that you want, there is no solution. You can't turn an Excel workbook into a website. Even if it is used as a settlement machine (a kind of "black box"), i.e. the site (web interface) takes the values ​​​​of variables from the user, loads the object, as Alexander advised you , transfers data to it via COM and takes new values ​​\u200b\u200bfor output from the third sheet, this will not work because of macros. Formulas in Excel.Application will work without problems, but not VBA.
Even if you rewrite the book with only built-in formulas, you will be faced with the need to choose only hosting that runs on windows. Yes, and providing the necessary COM object.
It will be faster and cheaper to find a student who knows VBA and, for example, C#. In principle, the server language already depends on the host platform (though PHP, Perl or even JavaScript, which does not depend on anything at all).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question