Help

Welcome to the OpenSolver on-line help.

We hope that most of your questions will be answered on the Using OpenSolver page. However, if you still have a question, please post it below.

Building  Linear Programming models

Writing optimisation models that only use linear mathematical equations and inequalities is not easy. However, most of the time you want to build these “linear programming” models (and avoid non-linear models) because these are easier and more reliable to solve using packages such as OpenSolver. (OpenSolver uses CBC by default to solve these linear programmes.) Check out this Wiki page on linear programming.

The AIMMS folks have a great online chapter describing how to take non-linear requirements (local copy of pdf) and model them using linear programming. (Thanks to Stu Mitchell of PuLP fame for pointing out this resource.) The NEOS guide is also a great resource. If you still have a modelling question (e.g., how do I express this requirement using the rules for a linear program), please ask it on https://www.or-exchange.org/.

Common Software Problems

Excel can have problems dealing with add-ons. Visit http://www.add-ins.com/how_to_repair_office.htm for a guide on fixing these.

1. OpenSolver not loading – July 2016 Office update (no error message)

In July 2016, MicroSoft released an update to Office 365 which prevents OpenSolver from loading unless the .zip file is “unblocked” before the files are extracted. (We expect this change to appear in other versions of Excel.) The symptoms are simply that OpenSolver does not appear in the Data tab; there is no error message shown. To fix this, delete your old OpenSolver files (but not the downloaded .zip file), right click the downloaded OpenSolver .zip file, choose Properties, and click the Unblock button which will show if the file is blocked. Once the file is unblock, close the properties dialog, and then un-zip the files and open up OpenSolver.xlam as usual.

2. Unable to find the external solver …

If OpenSolver reports this problem, then it could not find a solver file that comes with OpenSolver. Please check that you have extracted (i.e. un-zipped or uncompressed) all the files from the OpenSolver download.

3. The solver did not create a solution file.

If this error is reported, then it is likely that OpenSolver was unable to run the solver executable. This may happen if the OpenSolver files  are in an ‘untrusted’ location, and so Windows will not let them be run. First check whether the solver is shown as found in the “About OpenSolver” form. If not, go to the folder identified in the “About OpenSolver” form and double click on this solver file. You should then see a command window open that gives the solver name and version information etc. If you don’t see this, then Windows should give you an error message to help you diagnose the problem. It may help to move the OpenSolver folder (and all the files it contains) into a location such as your Documents, or even into Program Files, and try again.

4. Solver crashes; OpenSolver reports no solution file

The files in the “Solver” folder provided with OpenSolver contain the actual solver code. These solvers are being continually upgraded as bugs are reported and fixed. If OpenSolver reports that no solution file was generated, then the solver may have crashed. This can happen on big problems when the solver runs out of memory, but also on smaller problems that happen to hit a solver bug. In such cases, you should check if a newer version of OpenSolver is available since we regularly update the solvers included with OpenSolver as they are released.

With CBC, a typical OpenSolver error for thois problem message might be: ‘The CBC solver did not complete, but aborted with the error code -1073741510’

If needed, you can download the latest version of CBC, Bonmin or Couenne from AMPL. Download the either the Windows or Mac version as appropriate. For Windows, get the 32-bit version if you have 32-bit Windows, or the 64-bit version otherwise. (The 64 bit version will solve much larger problems than the standard 32 bit version included in OpenSolver, so always choose this if possible. Right-clicking on Computer, and choosing Properties, will tell you if have a 32 or 64 bit system type.) Right click on the downloaded .zip file, choose Properties, and click the Unblock button if there is one. Then, open the .zip file, and drag the files into the right location in your OpenSolver Solvers folder (the win32, win64 or osx folder as appropriate), replacing the existing files. This may fix your problem.

Report a CBC bug

If after installing the latest version of CBC, CBC still crashes on you, then you may wish to report a bug. Please be sure to include the .lp file produced by OpenSolver; you can open this file using “View Last Model .lp File”. CBC bugs can be reported by either:

  1. The online CBC TRAC bug reporting system (which you will have to register for), or
  2. The CBC mail list

Switch from CBC to Gurobi
Since August 2014, OpenSolver has also supported solving models using the Gurobi solver. You can obtain a copy of this solver at no charge if you are at a university. Gurobi is faster and more stable than CBC, and comes highly recommended.

5. Repairing Excel

Sometimes it is useful (if all else fails) to repair your Office installation:

Windows

See these Microsoft Office 2010 and later instructions (or in Excel 2007, use Excel’s application menu, then Excel Options, then Resources, then “run Microsoft Office Diagnostics”). You might also want to look at http://support.microsoft.com/kb/166273, which talks about this.

Mac

Unfortunately there is no easy way to repair the Office 2011 installation. The best option is to follow these instructions to completely uninstall Office. You can then install Office again from scratch to get a clean version installed.

6. ‘Can’t find project or library’ : Missing Reference Errors

OpenSolver uses the “RefEdit” control, which we need but which can cause problems because of missing references caused by version changes. To check for missing references, using the VBA editor (which you access using Alt-F11), select OpenSolver (openSolver.xlam) in the Project window, choose Tools… References, and look for a “Missing:” line. If you see this, un-check that line, close the dialog, and choose File … Save OpenSolver.xlam to update the file. If this doesn’t help, try the above steps for repairing Excel.

7. Error 70: Unable to delete the file: C:\Users\XXXXXX\AppData\Local\Temp\log1.tmp

This errors happens if Excel crashes while OpenSolver is running, leaving log1.tmp open. Please restart your computer, which will close this file, and try again.

8. OpenSolver was working on my Mac. Then I updated to Excel 16.16.7 (released late 2018) and OpenSolver stopped working. What do I do?

We have had numerous users report this issue. We are looking for a Mac user with VBA experience to help us diagnose this problem. Please contact us at email hidden; JavaScript is required if you can help.

9. OpenSolver does not work in Excel installed from the Windows Store

Windows Store versions of Office applications do not support Add-ins such as OpenSolver; see this link, or this support page for another add-in, or this technical article from Add-in Express. This Dell article explains a little more. If you have a Windows Store version, it will display this in the Excel Version information, such as in the following example:

Version 1807 (Build 10325.20082 Microsoft Store)

The solution is to un-install Excel, and install the click-to-run versions, in which case the Excel version will change from ‘Microsoft Store’ to ‘Click-to-Run’. Standard installs (meaning not Office 365) don’t have this issue.

2,127 thoughts on “Help”

  1. The solver is not accepting multiple variables and constraints. As soon as a new variable or constraint is added, the previous one gets deleted.

  2. Does opensolver work in the Excel that comes with Microsoft 365? If so how do you install it?

  3. Hi there, thanks for making this tool open and public.

    I am running a non-linear solver and get the error message “Method ‘Range’ of object ‘_Worksheet’ failed.” Can you provide guidance for what this means and how to resolve? My variable cells all feed into my objective cell and everything (i.e., there are no mismatches) and so I’m not sure what this could mean or how to resolve it. Thank you for your time and attention.

    sam

    1. Sam,

      Sorry it is not working.

      Our non-linear solvers are experimental, and so we offer limited support for them sorry. The error will be caused by a formula we don’t understand. I suggest to build the model up slowly until you find the problem. Also make sure you use old (not new) Excel formulae.

      I’m sorry that our error reporting is not very helpful – we are looking for contributors to make this better.

      Thanks,

      Andrew

  4. Hi,

    I am using Google Sheets addon. It works fine, but unfortunately adding constrains is very slow. I need to add many constrains, and it would take lot of hours. Is it possible to somehow open the source code of the OpenSolver and just copy paste my codes considering the right formats.
    Or any other faster method? 5 constrain was 5 minutes to set up. And I need way way more. Thank you

  5. Hi,

    I am using Google Sheets addon. It works fine, unfortunately adding constrains is very slow. I need to add many constrains, and it would take lot of hours. Is is possible to somehow open the source code of the OpenSolver and just copy paste my codes considering the right formats.
    Is it possible, or any other faster method? 5 constrain was 5 minutes to set up. And I need way way more. Thank you

  6. Dear Mr. Mason,

    I would like to ask a newbie question about how to use OpenSolver.
    My problem is I would like to find which numbers in a data set sums up to a specific Total number.
    The model I used:
    + Column A: The numbers
    + Column B: Multiplier which is all set to 1 (Variable cells)
    + Column C: The product, which is multiplication between Column A & B
    Then I set the difference between the specific Total I want to find, and the sum of products to be equal to 0.
    Then I set Variable cells with the following constraints:
    + Must be larger or equal to 0
    + Must be smaller or equal to 1
    + Must be an Integer
    I solved using CBC engine. It returned the message “No feasible solution”.
    The problem solved just fine with Excel add-in.
    Can you please help me what I did wrong? Thank you very much!!

    1. Thanks for your question. Are you building a model that looks like this one?
      https://www.youtube.com/watch?app=desktop&v=_29xQjDzfA4
      We have identified an OpenSolver edge-case bug for some examples where an objective function target is specified. It works fine if you enter the target value in the “Target Value” cell, but can fail if this is modelled in other ways (such as using the approach in the video above). We are working on a fix for this.
      Cheers,
      Andrew

  7. My Opensolver produces FLOAT-Numbers (3.1114412) and not Integer (3).
    How can i change it to only calculate with full numbers and not Floats?
    e.g. it is not possible to produce 0.1114412 cars/tv’s / houses …

    1. You have an option in the contraints section to set “int” constraints. You can apply it to all variables you want to remain as integers (such as produced TVs count). However this approach can hardly slow down the solving process if you have a lot of variables and contraints, use it only if absolutely necessary. Kind regards, Alexandre

  8. This is probably just a newbie question for Excel/VBA, but I found no answers online.

    Office 365, “standalone apps”. All files are unblocked.

    I double-click the xlam file, and end up with a small dialog, “Microsoft Visual Basic for Applications”, “Error in loading DLL” (and no mention of *which* DLL, thanks MS). This takes me to the VBA debugger. I click on “Show Next Statement”, and it is Private Sub Workbook_Open(). Further “clicking” ends up with “Automation Error”, “Unspecified error”.

    Internet says check for MISSING: with the References. There are none.

    I don’t see anybody else having this problem?

    I’m using opensolver with another persons trusted setup, so I’m not programming anything myself, and lots of people use his stuff (and obviously opensolver) with no issues.

    1. Sorry, I don’t have any good ideas. You can try repairing your Excel installation; that sometimes helps. Maybe the community has some suggestions? Andrew

  9. Hi
    I used opensolver in my research. It provided serious convenience compared to the Excel solver. Thanks a lot for your hard work. I need information about a problem and support if possible. Are there methods using Genetic Algorithms in solution engines? I couldn’t find it when I looked at the related engines. Are there alternative possibilities?
    Thank you for your interest
    My Best regards

    1. I did my PhD research on GA’s, so I know them well, mainly in the context of combinatorial problems. I would always recommend you start by trying simpler local search strategies such as Nomad or a custom strategy before trying a GA – there is no theory or practical experience that says the GA will work better, and indeed in most cases it will be worse for the same running time. So, no, OpenSolver does not have a GA. Cheers, Andrew

  10. I am trying to solve a non linear problem and i gwt this eror:

    20 ene 23 00:02:41 [OpenSolver.xlam] CModelParsed.AddNodeIfNew: Line 56
    20 ene 23 00:02:41 [OpenSolver.xlam] CModelParsed.ExpandFormula: Line 132
    20 ene 23 00:02:41 [OpenSolver.xlam] CModelParsed.ParseFormulae: Line 87
    20 ene 23 00:02:41 [OpenSolver.xlam] CModelParsed.ProcessSolverModel: Line 8
    20 ene 23 00:02:41 [OpenSolver.xlam] COpenSolver.BuildModelFromSolverData: Line 199
    20 ene 23 00:02:41 [OpenSolver.xlam] OpenSolverAPI.RunOpenSolver: Line 9

    Error 9: Subíndice fuera del intervalo

    Solver: NeosBon

    OpenSolver version 2.9.0 (2017.11.10); Distribution=Advanced
    Location: “C:\OpenSolver2.9.0_AdvancedWin\OpenSolver.xlam”

    What can i do?

    1. The non-linear support is experimental and relies on us being able to understand all your formulae. Something in your sheet is breaking this (and our error messages are not so helpful, sorry). I suggest adding constraints one-at-a-time until you find the formula causing the issue. Parsing the s/sheet is challenging – we try to do it, but we do not have the resources to keep updating this as Excel improves, so newer formulae (and some old ones) are too hard for us. Andrew

  11. Running OpenSolver 2.9.4 Beta Advanced on Excel 2013. I have a non-linear problem. When I solve with Bonmin or Couenne it returns “Out of stack space”. NOMAD gives no solution. I have about 1000 variables and 2 constraints. When I limit the variables to 200 and use the Excel Solver it will return a solution. It should be solvable but I don’t know how to get passed the “Out of stack space” error. Any help will be appreciated. Thanks!

    1. I think your model is too big for the amount of memory you have, sorry. Your formulae may be are too complex for the formula parser we use. NOMAD should be able to solve anything if you wait long enough… Andrew

  12. I am experiencing an issue once the app is installed in google sheets; the add-on is greyed out and won’t open. Please advise.

  13. I am using OpenSolver with google sheets.
    I works very well. However, if the cell name contains spaces, the solver tab doesn’t update cell references correctly.

    example: my first sheet was called ‘ex1 – p1’, second ‘ex1 – p2’ and so on. When trying to update variables, objetive etc for the second sheet, nothing happened. I went back to the first and ran its solver again. It worked OK, because references weren’t lost.
    Tried updating values from the first sheet (now renamed with the spaces) and it didn’t work.

    I did, however, manage to use it by renaming sheets from ‘ex1 – p1’ to ‘e1p1’.

    1. Thanks; that is very useful feedback. I hope that one of our summer students (NZ summer time) has Javascript skills to look at this. Andrew

  14. Hello.
    I am using OpenSolver 2.9.3 to analyze forest management problems.
    I wonder how much data the OpenSolver can handle.

    Thanks

    1. It is only limited by time and memory, and the very-problem-specific complexity required to create integer (not fractional) solutions. That said, SolverStudio (http://solverstudio.org) is much more powerful, but has more of a learning curve. Andrew

Leave a Reply to Andrew Mason (Team OpenSolver) Cancel reply

Your email address will not be published. Required fields are marked *