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,138 thoughts on “Help”

  1. Hello
    Thank you for providing open solver and help!
    I am using optimization for solving a yearly based problem meaning that we plan year by year to minimize cost for each year and find the best solution for whole time horizon; however, this optimal approach is not necessarily a global optimal solution for the whole period. I should mention that each year decisions are impacted by previous year and impact the following year. To find a global solution, I tried to run it for two years together (selecting the all years variables and combining the two objectives) instead of year by year and the first error is that the model is not leaner(although yearly based works well by linear) and then I used non-linear engine and the error is mis-matching!
    Could you please help me in this regard.
    Is there any option here to help. I tried all engines.
    Thank you
    Alireza

    1. If one year is linear, then I’d expect two users to also be so. I suggest you think carefully about developing a linear multi-year model. Good luck, Andrew

  2. When I try to use the NEOS-CBC solver, my job gets terminated after 5 minutes every time. According to the NEOS FAQ, jobs can run for a maximum of 8 hours but may hit an iteration limit before that time. However, that’s not what’s happening. From their FAQ:

    “Jobs submitted to the NEOS Server can be assigned as short jobs, which means that they can run at most 5 minutes. Use the tag to assign a priority to a job.”

    I’m not sure if it was an intentional decision to limit the jobs’ runtime or what, but it would be helpful if you used the tag, or at least gave an option to do so, so that jobs don’t always get the axe after five minutes.

    Otherwise, thanks for your program. It’s great!

  3. Hello,

    I have been testing open solver with an extremely simple nl problem and whenever I attempt to use the Bonmin or Couenne nl solvers on my local machine I get the following “error” message in the log (note: this does not happen for any of the other solvers). However, if I make a first solve attempt using either of these two solvers, they will reach a solution, but only on the first try. After that I again get the message below regardles of which nl solver I use, and I then have to restart Excel to use any of the other nl solvers. The caveat to this is the Nomad solver. If I only use Nomad, none of these issues arise.

    Error Log:

    29 Jan 20 19:58:07 [OpenSolver.xlam] SolverFileNL.SolveModelParsed_NL: Line 13
    29 Jan 20 19:58:07 [OpenSolver.xlam] SolverCommon.WriteModelFile: Line 16
    29 Jan 20 19:58:07 [OpenSolver.xlam] SolverCommon.SolveModel: Line 42
    29 Jan 20 19:58:07 [OpenSolver.xlam] OpenSolverAPI.RunOpenSolver: Line 11

    Error 9: Subscript out of range

    Solver: Bonmin

    OpenSolver version 2.9.0 (2017.11.10); Distribution=Advanced
    Location: “C:\Users\x\AppData\Roaming\Microsoft\AddIns\OpenSolver.xlam”

    Excel 16.0; build 12513; 64-bit; VBA7
    Excel product code: x
    Excel language: English – US
    OS: Windows 10.0; 64-bit
    Username: x

    CBC v2.9.4 (64-bit) at “C:\Users\rsgre\AppData\Roaming\Microsoft\AddIns\Solvers\win64\cbc.exe”

    Gurobi v8.0.0 (64-bit) at “C:\gurobi800\win64\bin\gurobi_cl.exe”

    Bonmin v1.8.4 (64-bit) at “C:\Users\rsgre\AppData\Roaming\Microsoft\AddIns\Solvers\win64\bonmin.exe”

    Couenne v0.5.6 (64-bit) at “C:\Users\x\AppData\Roaming\Microsoft\AddIns\Solvers\win64\couenne.exe”

    NOMAD v3.7.1 (64-bit) using OpenSolverNomad v1.3.1 at “C:\Users\x\AppData\Roaming\Microsoft\AddIns\Solvers\win64\OpenSolverNomad.dll”

  4. Hi,
    Attempting to download OpenSolver, I ran into two error messages after Step #4 . The first error was “Microsoft Visual Basic for Applications….Object library invalid or contains references to object definitions that could not be found”. The second error was “Microsoft Visual Basic for Applications….Compile error in hidden module: SolverCode. This error commonly occurs when code is incompatible with the version, platform, or architecture of this application. Click “Help” for information on how to correct this error. ” What steps are required to overcome these errors so that I can successfully download OpenSolver?

    Thanks!

    1. Sounds like repairing Excel would help; the second error message is for Solver, not OpenSolver. Andrew

  5. I cannot get the SetObjectiveFunctionalCell to work. I am new to opensolver and VBA . I would like to run my model against one set of data trying to maximize the value in Cell T6 then I run the model again trying to maximize the value in cell T5. I have this set up in the standard Excel Solver, but I do not want to be limited to 200 lines of data. I understand that the ObjectiveFunctionalCell needs to be input as a range, but I cannot figure out what that is supposed to look like. I tried Range(“T5”), but no luck, as I get a run-time error 424 error. An example or two of what that line should look like would be helpful. Thank you

    1. We are working on this, but hitting some challenges with the Google processes. Sorry about this. Andrew

  6. Please, I do need help…
    I made a model in Google sheets, that’s using a mean (so this has two senses, yes, it’s mean value and a mean problem :)) for calculating the linear difference of a cell from that mean.
    Actually, one can run in trouble by dividing by zero, so I used

    =IFERROR(
    (2*D81/(D74+D75))-1
    ;
    0
    )

    to avoid this in a cell on the model sheet and to return zero in case the divisor is zero.

    Obviously after adding this to a double constraint like
    [cellA1] >= -0,75
    [cellA1]<= +0,75
    to keep the mean difference in a certain range Open Solver runs into endless modeling, not responding forever.
    I suspect the "IF-whatsoever()" is disturbing linearity.
    Am I right? But – if I'm right, how to catch the #DIVzero error? If I feed the error into the constraints during runtime, I guess, it will break the solve run, too.

    Any ideas will be greatly appreciated!
    Thanks in advance, Kai

    1. Hello, does it mean that cells D74 and D75 are variable cells for solver?
      If it is right you model is not linear.
      You also can not use “abs” in formulas which use figures from variable cells.

      In my case we used “quality” in goal. But for calculating quality we had to divided sum of production on sum of variable cells.
      I had to change our model to avoid non-linear

      You also can check your model. In options choose “Perform a quick linearity check on the model”

  7. I get this message when I try to install the add-on on google sheets:

    “Sign in with Google temporarily disabled for this app”

    It will not let me go any further; I’ve used opensolver about a year ago with no problems.

  8. hi,
    my model is not executing says could not find solver folder . i have extracted all the files in opensolver folder

  9. Dear Sir,
    I’m try to download the Opensolver to my computer. however unable to install. I try several time. Would you please advise how to do the install method.
    Computer detail;
    OS Windows 10 professional
    Microsoft office 365

    Thanks and best regards.
    Chanchai Aksorndet

  10. Went to open the add-on, which I use almost daily, and got this error message tonight:

    “Add-on not available in G Suite Marketplace
    The developer of this add-on has not accepted the terms and conditions of G Suite Marketplace.”

    1. Please try again… we have ticked a few more boxes and published OpenSolver in the Google Marketplace. Andrew

  11. Hi. I want to use Nomad as my Solver Engine but the setup for Nomad was not included the zip file for the installation of Open Solver. I downloaded the setup separately and saved it in the Solver set up folder but I still cant use it

  12. How do I use VBA to write a script that can loop through a repetitive process to select constraints? I have 5700 constraints in my model and would like to save some time. Thanks.

  13. Hi,

    I am trying to build optimization model for Manpower planning of warehouse. It has two types of Manpower req. operator and labour. Warehouse activities for which Manpower needs to be planned are outbound, Inbound and inventory transfer. While day on day outbound numbers are fixed, inbound and inventory transfer are variables constrained by a monthly number which should be met. To solve this my objective function is coming in the format of “x*y” which I am not able to linearize. And, hence I am using non linear solver (Bonmin). Though it gives result in first run but if I run it again it shows error as “subscript out of range”. Any thoughts on why would it be happening and how to solve it?

Leave a Reply

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