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. Hi,

    i’m trying to solve a model that i built but the the software is not able to find the cbc file.

    This is the error that occurs:
    OpenSolver 2.7.1 encountered an error:
    Unable to find CBC (‘cbc.exe’). Folders searched:
    “C:\Users\Andrea.Txxxxx\AppData\Local\Temp\wz8b17\Solvers\win64”
    “C:\Users\Andrea.Txxxxx\AppData\Local\Temp\wz8b17\Solvers\win32”

    2 ponits:
    1) The folders that it mentions don’t exist
    2) From the message seams that i dont’ saved the file downloaded but i did it

    Can you help me?

    Thank you in advance.

    Andrea

  2. Hi,

    I got the following message while trying to install OpenSolver.

    “OpenSolver 2.8.2 encountered an error:
    There is no model to solve, and so the quick solve cannot be completed. Please select the Initialize Quick Solve command.”

    I tried to use the latest version (2.8.2) but result is unchanged. What can I do?

    By the way I’m running Office 2016 Business 32-Bit on Windows 10 x64.

    Any advice?
    Best
    Quentin

    1. That does not look like an installation error, but indicates you have not yet set up a model to solve. Andrew

  3. I am trying to incorporate the OpensolverNOMAD.DLL in a particual project, without the full Opensolver functionality. To do this I think I would need to adapt the DLL. Is it possible to get the source code for the DLL so I could modify the references.

    1. The NOMAD source is available here:
      https://www.gerad.ca/nomad/Project/Home.html

      Our setup for building the NOMAD source into a library is here:
      https://github.com/OpenSolver/OpenSolverNomadLib

      The code for our DLL wrapper around the NOMAD library is here:
      https://github.com/OpenSolver/OpenSolverNomad

      Please be aware that the NOMAD source is covered by the LGPLv3 license, and our DLL wrapper by the GPLv3 license. Make sure that any use of the code is compatible with these licenses.

  4. Hi,

    I am trying to set up a solver using Quick Solve; however when I click ‘Set Quick Solve Parameters’ nothing happens. I get the following error message when trying to ‘Initialize Quick Solve Parameters’:

    ‘OpenSolver 2.7.1 encountered an error:
    No parameter range could be found on the worksheet. Please use “Initialize Quick Solve Parameters”to define the cells that you wish to change between successive OpenSolver solves. Note that changes to these cells must lead to changes in the underlying model’s right hand side values for its constraints.’

    Do you have any idea what I might be doing wrong? I have set up a solver with several constraints which works fine when solving normally but fails to work using Quick Solve.

    Thanks,
    Tom

    1. Please try the 2.8.2 pre release version… that fixes this bug. Sorry about it not working. Andrew

  5. I am getting the following error message:
    “This key is already associated with an element of this collection”

    Below is the log file:

    Error 457: This key is already associated with an element of this collection
    09 Sep 16 12:39:40 [OpenSolver.xlam] OpenSolverAutoModel.AddConstraint: Line 3982
    09 Sep 16 12:39:40 [OpenSolver.xlam] CModel.LoadFromSheet: Line 4026
    09 Sep 16 12:39:40 [OpenSolver.xlam] FModel.UserForm_Activate: Line 4350

    Error 457: This key is already associated with an element of this collection

    1. Please try the 2.8.2 pre-release version. If this doesn’t work, I suspect you have a non-linear s/sheet with a model that is too complicated. Please try simplifying the formulae, or change to the NOMAD solver. Andrew

  6. Hi, I have a model with around 130k variables and 19 constraints which takes around 9 hours to solve but ideally I want to run it two or three times a day.

    My model is effectively maximising the Sumproduct of two tables. One table is the variable cells which are all binary. The second table is just manually inputted numbers.

    The only thing that changes between solves is the manual inputted data, all constraints remain the same.

    Can I use the Quicksolve function for my scenario, and if so how?

    Thanks

    1. No, sorry, as the Quick Solve tool curently only allows changes in the right hand sides of constraints. Andrew

      1. What if I add a new set of variable cells, and a new constraint = the manual data. That way the changes are on the right hand side, no?

        1. As long as you only change the constant b in the linear equations a1 x1 + a2 x2 + … <= constant then it will work. Andrew

  7. Ok so with NOMAD working good now I tried both BONMIN and COUENNE but get “error 5 invalid procedure call or argument” in the error log just after they finish evaluating constraints…

    1. Sorry it is not working. Are you able to send us the spreadsheet, to email hidden; JavaScript is required? Also, can you confirm that you are not using any Excel-specific functions, such as lookup()’s, or if()’s. Andrew

  8. Turns out I had overlooked an unwanted circularity in a newer portion of the model… Excel did not warn me about it since it always had iteration enabled.

    Everything works fine now.

  9. My model is essentially a 10th degree polynominal curve which is a function of discreet frequency values from 1000/60 Hz to 9000/60 Hz. In my application, NOMAD is fed five desired frequencies at which a “real” impedances sum needs to be minimized. I have managed to get NOMAD running breaking up the sum and minimizing instead one filter order at a time…

    1. Pleased it works. But I would avoid using NOMAD if at all possible; BONMIN or COUENNE are much better if you can keep to straightforward formulae in your spreadsheed. Andrew

  10. Hi, I’m having a problem with solver asking me to disable iteration because it may be interfering with the ititial calculation… But my model cannot work without iteration set to automatic.

    1. Do you mean SOlver or OpenSolver? Either way, you cannot have model that uses circular references if you want to use a linear solver like CBC or Simplex LP.

      1. Thanks for the update. We have not designed NOMAD to allow iterative calculations, but there is no reason why it cannot. (The other solvers won’t like it, but NOMAD should be ok.) I will add this to our ToDo list; keep an eye out for the next release. Sorry we cannot be of more help at this stage. Andrew

  11. Hi Andrew,

    I seem to have the same problem as Rawan. After downloading Opensolver, extracting, and opening the .xlam file, I can’t see OpenSolver under the data tab.

    Weird thing is, I downloaded it a few days ago and it worked fine, but now I can’t see it any more.

    I’ve checked the add-ins and it isn’t disabled.

    After re-downloading, it still doesn’t appear, and doesn’t appear in the add-ins manager either.

    Running windows 10.

    Cheers

    1. Are you using Office 365? That may be the problem as it seems to have been updated recently. Andrew

    2. As Andrew said, there seems to be a recent change to the Office 365 security settings. Can you please try the solution I’ve just posted here and see if that fixes things.

  12. I have Office365 on Win8. Havent used OpenSolver for about two weeks and now does not appear in the ribbon anymore.

    Whener I start the .xlam then Excel opens but nothing happens. It is just a blank instance of Excel. When I start the .xlam while I have a file open nothing happens either.

    1. There seems to be a change to the Office 365 security settings. Can you please try the solution I’ve just posted here and see if that fixes things.

        1. Another either approach we recommended is to “unblock” the opensolver zip file before extracting the files. To do this, right click the .zip file, choose Properties, and click the Unblock button. Then continue as usual. Andrew

        1. Is it a Mac? Have you checked the Add-Ins : Disabled Items under the File menu?

            1. I tried restarting + downloading open solver many times

              Yes it is Mac, I checked the Add-Ins there is only Solver and Analysis ToolPak

              1. The latest Excel for Mac is broken for add-ins; OpenSolver does not work for this version, sorry. A>

                    1. There has just been a major Mac Office 2016 update a few days ago. Does that fix the problem?

                      If not, then is there a chance that OpenSolver will work with it at some point this Autumn? The comments that it does not work seem pretty final …

                      Best wishes,
                      W.

                    2. We will be addressing this when we release the next version, which should hopefully happen in the next week. We have been slowly working around the problems caused by Mac Office 2016 (and waiting for Office updates to fix random bugs in Excel). Our current working copy has basic support for the standard linear solvers (we can solve our entire suite of 60+ test problems using CBC and Gurobi). We intend for the version we release soon to have this very alpha-level support for Mac 2016 so that we can get extra testing from users, but unfortunately we won’t be able to promise any level of stability just yet.

Leave a Reply

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