# Access solver by scripting?

Hi there,

As far I see, it’s not possible to access the solver by script? If it would, I could include it inside my Monte-Carlo-Simulation: draw random variables as an input (this are e.g. parameters that describe what’s happening in the world) and then calculate the optimal response. Currently, my response is either fixed (e.g. I spend 1000, now matter what the price is) or calculated by a fixed formula: I spend 1000 + 100/price).

I would set up the solver (Solver Configuration on a Cell X), containing input fields (depending on my random variables), constraints, solver algorithm, … beforehand, and the minimal needed function would be:

**Cell.SolverConfiguration.Solve(true) to run the Solver, with a flag as an argument to suppress the Dialogbox in the end.**

Obviously, it might also be interesting to read (or even write) the SolverConfigurations.properties itself …. but this might be too much to ask 🙂

Please comment if there is a workaround I miss.

Or comment if you think this would also be handy for your applications!

Thanks, Gilbert

P.S.: One tricky thing: if solver is not triggered as part of the recalculation, but individually by script, I will need another recalculation to propagate the results of the solver. In this second recalculation I do not want to re-trigger the volatile random functions, but only recalculate formulas that were invalidated by the solver results. …

Today it’s not possible to access Solver functions via script. As you suggested it would be tricky to allow this due to the nature of the way calculations work automatically according to a dependency graph in the background, but Solver does not. We will keep this idea in mind for the future, thanks for the suggestion!