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,
    I can not install the add- OpenSolver.xlam . The message is inserted smart card . I have Excel 2010

    Domenico

  2. Hi, is there any way to formulate & solve an LP with a quadratic objective function (all variables real, all constraints linear)? I. e. QCP with OpenSolver?

    Thanks, Philipp

    1. Yes, use Bonmin or Couenne as your solver (and keep the spreadsheet formulae simple enough for OpenSolver to convert them into an input file for the solver). Andrew

  3. Hello, I’m trying to find out how it works to delete a constraint with VBA language. I already found out that it should be like : DeleteConstraint(Index As Long, Optional sheet As Worksheet).

    But as I am a beginner, I do not know what “index” should be.

    For example, if i add this constraint : AddConstraint Range(Cells(5,198)),RelationEQ,,”1″, how will i be able to delete it ?

    Thanks by advance for your help,

    1. Opensolver dpes not yet do multi objective optimisation automatically. But you can do the epsilon method using VBA or the new Scenario Mgr we will be releasing sometime soon. Andrew

  4. Hello,

    I have Excel 2016 for Mac and after it is installed it generates a (451) error. Any idea when this will be stable for Mac Excel 2016?

    Thanks,
    Dan

    1. We have been waiting for Microsoft to improve the state of Mac Excel 2016 before we fix these problems. The version they released last year was very unfinished, and they are only just starting to add basic features through updates, like the ability for us to add a menu (which became possible just a few weeks ago).

      In particular, the VBA support is very limited, and the editor is missing a lot of features, which make it very hard to debug these errors like you are getting and fix them. So we are waiting until the tools catch up before we try to fix these problems.

      In the meantime, we suggest running Excel 2011 (which can coexist with 2016 without issue) for OpenSolver, or using a Windows version of Excel inside a virtual machine (which is probably faster than using Excel 2011/2016 on Mac – this is also what Frontline Systems recommend for the standard Excel Solver)

  5. Hello,

    I am using open solver and I need to be able to input my restrictions using named ranges rather than ranges with “addresses” (A1:B20). When I input the name the model accepts but then it converts to the actual addres and if I change the size of the named range, that change is not reflected in the model.

    How can I address this?

    Regards,

    Luis

    1. Opensolver always stores ranges by address not name. If you enlarge an address range by inserting rows or columns into the *middle* of the range (not by expanding the edges) then Excel will tell OpenSolver about the change. Andrew. PS I will add an an item to our requested changes to remember named ranges… it would be a useful improvement.

  6. Good morning,
    some time we use the solver OpenSolver that is on your server . We have a network that is protected by firewalls . To reach your server we need to know the exact address . It’s possible? To date we have used a connection with an internet key but does not always work . We look forward to your kind reply .

  7. Hello,

    I am interested in setting up a spreadsheet with multiple models. I have proven that the OpenSolver add-in can solve one of those models, but what can I do if I have 2 or more seperate models I want to solve on that sheet?

    Thanks

    1. You can only have one model, per sheet. I suggest the extra models go on other sheets (but still reference cells from the first sheet where your equations are). Andrew

  8. Hi,

    Until now I have used OpenSolver with CBC successfully for many linear models. Thanks a lot for this great program!

    Now I built a small nonlinear model and OpenSolver seems to hang when modelling certain constraints. In the Excel status line I read “OenSolver: Constraint Progress: 9/14. Processing formula 296/296”, but then there is no progress any more. I need to quit Excel and restart the PC.
    Is it the formulation of a constraint or a bug?
    It makes no difference whether I choose BONMIN or COUENNE as a solver.

    I use OpenSolver 2.7.1 Advanced on Win7 (64-bit) and Excel 2010 (32-bit).

    If you let me know I can send you the Excel sheet.

    Best regards

    Christian

    1. On non-linear models using Bonmin/Couenne, OpenSolver can be slow, but should not hang. Please try the next version when it comes out; we have improved our formula parser. Andrew

  9. Hi,
    I’ve tried to put the add-in under C:\Users\”user name”\AppData\Roaming\Microsoft\Addins to load automatically however it doesn’t load.

    Thanks,
    Sunny

    1. Please check your Excel’s documentation to confirm this location. Or you can use the check box under About OpenSolver. Andrew

  10. Thx, this is a great tool and allows one to bypass learning a solver language.
    I’m interested in optimizing a series of objective cells across a set of consecutive constraint ranges (a time series), one by one as they are not individually dependent on the preceding state. When I try to optimize all time slices at once, I sometimes get an unfeasible response.

    I have some familiarity with VBA, but I’d appreciate some guidance regarding where the primary routines reside for me to automate the revision of the model to solve one time period at a time. Within a loop, I will need to update the refObj, refDecision, and lstConstraints programmatically; and then run the solver.

    Rick

  11. Hi,

    I am doing a LP model with minimisation of value as the objective cell. The Objective cell value is gained from an output of a if function that provides a 1 if the unit is utilised multiplied by its rate per unit. I am aware that the standard Solver doe not like the if function. Is this also an issue with Open solver?

  12. Hi i’m tryng to solve an LP with your solver,but i didn’t undertstand how to define the problem.
    In particular how can i select the variable cell?I have to select them from the data-sheet,that i already have, or i must define them in an implicyt way.

  13. I am new to this. I want to leverage an Excel solver (opensolver) by feeding variables to an external .exe that would compute my responses and objective. Does that make sense with opensolver? Or is that the point of opensolver? Thanks for any advice, and forgive my ignorance on these things! Mark

Leave a Reply

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