Solver within Basic

Hello everyone. Quick question on using solver within a macro. Thanks in advance for your time/replies.

Is there a way to handle the Solver function programmatically? Note that it is under Tools → Solver… Basically, I know which cells need to be iterated through to find a maximum but I don’t want to have to go to the menu every time. I want to do this task programmatically within a larger macro. Is that possible?

You may study the thread about API and Solvers I started myself a few years ago. It contains some secondary links, and useful statements by @mikekaganski.

Python LibreOffice Programming Calc Chapter 27. Functions and Data Analysis, 27.4 Linear and Nonlinear Solving is a good resource for python an more.

Also there is Examples of Linear Solve in a spreadsheet (in python) on LibreOffice Python UNO Examples.

Hope this can be helpful.

[Solved] Use the Solver by coding

Thank you for the replies. I appear to have it figured out now. There is good information related to this thread in all three of the previous replies. Thanks again.

Edit I tried to mark all three of your replies as the solution but can’t. :confused: In reality there is good and unique information contained within the links of all three.