K
K
Katya Smirnova2020-11-15 17:04:39
PHP
Katya Smirnova, 2020-11-15 17:04:39

php integration with excel macro?

There was a need to integrate a Laravel site with a program written in excel. This is the first time I've met with this, so I don't understand what to do at all.

The program is an estimate calculator, which, depending on the parameters substituted, gives the final price of building a house.

I read about the PhpSpreadsheet library, but I did not find in the documentation how to work with macros.

The program looks like this:
Screenshot

That is, you just need to pull the program to excel at the request of the user on the site, substituting all the necessary parameters, and return the final price.
Help me please!

UPD: The option to "rewrite" the code will not work for me. The program can be updated by developers, it will simply be impossible to support all this, given that the program is not the smallest

Answer the question

In order to leave comments, you need to log in

5 answer(s)
B
batyrmastyr, 2020-11-19
@sireax

1. In the macro itself, add sending data to your application.
1b. If not all users of the macro can be trusted, then instead of sending from the macro, you can return the result of the macro in JSON, which the user himself will insert on the site.
2. About how we launched real MS Excel in PHP ...
3. Use libXL , but it's in C ++ and there seem to be no wrappers for php.
4. Instead of the recipe from option 2, you can use OLE and run a special php script from under Windows and manage Excel.

A
Adamos, 2020-11-15
@Adamos

Convince "developers" to abandon the technologies of the last century and make an online calculator. With the API, if anyone else is using it. In a year, they themselves will be grateful to you for this evolution, so blackmail and torture can be used to convince them.

V
Vladimir Korotenko, 2020-11-15
@firedragon

Rewrite everything to vue will be faster

M
mletov, 2020-11-15
@mletov

I dealt with a similar task, but there all the business logic of calculations was in stored procedures / functions in the database.
The web application and macros just accessed them.
Not your case?

A
Anton Shamanov, 2020-11-16
@SilenceOfWinter

Can you be more specific about what kind of integration we are talking about? You will most likely need to rewrite the macro in php, and get the data for it using PhpSpreadsheet. Its developers abandoned the hemorrhoids with complex macros and did the right thing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question