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

  1. Hi, I am having the same cbc.exe security issues as everyone else, and am trying to find a workaround while I work with corporate IT to get it unblocked.

    The first step OpenSolver takes when you click solves appears to be compiling the Excel information into a format that Coin-OR recognises (AMPL, MPS, GAMS) then my guess is that this file is then imported in solver. Where is this (AMPL/MPS/GAMS) file generated? Can I access it and then drop it into the NEOS Solver (I have been unable to access NEOS through OpenSolver)?

    1. OpenSolver let’s you see all the files it creates using the OpenSolver, View All OpenSolver Files…
      Be sure to choose this only after having solved your model. Hope this helps, Andrew
      PS: Please report back on your efforts to allow Excel to run .exe files so other users can make these changes.

      1. Specifically for our organisation the issue arose from us changing from our previous security system to Windows Defender – which is blocking cbc.exe from being called through Excel (cbc.exe runs fine by itself). This change to Windows Defender has caused multiple issues across our organisation with Macros etc. – seems to be much stricter than previous system. Unfortunately, IT have explained this is not an easy fix as apparently the file runs with a different path, and a different file hash every time so they have to figure out how permit this specific item, without just turning the global rule off. Additionally, the file is being flagged as malicious, so they need to confirm that is a false alert first. Will update if they find a fix.

        In the meantime, can you suggest any work arounds? I have developed a fairly complex MILP that I need to solve ASAP, and I need OpenSolver to do it. I thought I could get OpenSolver to generate the .lp file then upload it into NEOS or upload into cbc.exe manually, but if OpenSolver needs to actually Solve to generate the .lp file then that path isn’t going to work for me. Unfortunately, I have fairly limited knowledge of the computing side of MILPs which is why OpenSolver was such a useful tool for me.

        1. Thanks for the detailed reply. The file cbc.exe runs from the same place every time, and is not altered after you unzip it. Maybe your IT team is referring to the input .lp file that is given to cbc.exe? That will be different everytime, and is in a different random folder. But your IT can hopefully just add cbc.exe to an approved list so Defender doss not block it. (This location depends on where you unzip OpenSolver, so will vary by user unless you standardize your OpenSolver install process.) Hope this helps. Andrew
          PS Cbc.exe being flagged is easy to check by looking at virustotal. (I think I have the right name…)

          1. FYI, I relayed your message above to IT and they said – “its not just defender. its many different environments. is it defender, is it attack surface recovery, is it actionable via SCCM or intune as we have both in our environment” – but I have a feeling he’s making this harder than it needs to be…

            Can you think of any way to run the solver without activating cbc.exe through OpenSolver? I can’t get access to the .lp file unless it solves?

            1. My assumption is that cbc.exe is being blocked by the “Attack Surface Reduction” rule “Block all Office applications from creating child processes“. My limited research (ok – I asked ChatGPT) says that an exclusion needs to be added for cbc.exe. (The exclusion is not for Excel itself, but for the file Excel is opening.) This is what ChatGPT suggests:

              In your case, where Excel opens cbc.exe, you should exclude cbc.exe, not excel.exe.
              Why?

              The “Office apps launching child processes” (ASR Rule ID: D4F940AB-401B-4EFC-AADC-AD5F3C50688A) blocks Excel, Word, and other Office apps from creating child processes. If cbc.exe is blocked when launched by Excel, you need to add cbc.exe to the ASR exclusions so that it is allowed to run.
              How to Exclude cbc.exe
              Using PowerShell

              Run this command as an administrator:
              Add-MpPreference -AttackSurfaceReductionOnlyExclusions “C:\Path\To\cbc.exe”

              Replace “C:\Path\To\cbc.exe” with the actual path of cbc.exe.

              Please let me know if this works.

              You also asked about running cbc manually. Yes, you can do this, but you cannot load the solution back into Excel; you will have to look at the output file (called “model.sol”) to see the solution. The command (typed into a PowerShell prompt) will be something like:
              D:\OpenSolver\OpenSolver2.9.3_Beta_AdvancedWin\Solvers\win64\cbc.exe -directory C:\Users\username\AppData\Local\Temp\OpenSolver-B4FC -import C:\Users\username\AppData\Local\Temp\OpenSolver-B4FC\model.lp -ratioGap 0.01 -seconds 2147483647 -maxIterations 2147483647
              Use “View Last Model File” to find where OpenSolver has saved the model, and update “OpenSolver-B4FC” (and “username”) above to specify this location.

              Hope this helps,

              Andrew

              1. PS: The following ChatGPT prompt is what I used: “How do I create an exception for the “Office apps launching child processes” attack surface reduction rule to allow Excel to open “cbc.exe””

  2. Hi!

    I downloaded opensolver advanced edition version 2.9.3 to solve some non-linear problems I had, I just have a few issues.

    – Bonmin solver gives extreme solutions and doesn’t seem to care that its goal was to minimize.
    – Couenne solver gives a solution that’s decent but definitely not the best, I can find one by hand that’s better quite easily.
    – NOMAD solver doesn’t want to open no matter how much security I remove from the program, I don’t know how to get it working at all. The error just says ‘unable to access the NOMAD solver add (the file location that it has)’ with errorcode -2147220504

    Any help is greatly appreciated!

  3. open solver is giving following error in macbook pro M2 osx vetura 13.2.1
    Office 365.
    opensolver 2.9.3 encountered error at ‘/Library/OpenSolver/Solvers/osx/cbc’
    Unnable to access cbc at the above location.

    I have checked and the file is present in that location.

    1. This sounds like a security issue. Microsoft have made Excel on Windows more secure by preventing it running external programmes… they may have done someting similar on Macs. These strict settings are often set by company administrators. See if you can give Excel more permissions. Sorry I cannot be more helpful… this is a new issue for us. Andrew

  4. Can you guys make a version of the Evolutionary solver that allows us to specify the increments to test? I typically only need to test integers or with low precision. The problem with the Excel Solver is that it wastes time testing high precision numbers. For example, if I want to test 0-100 integers, Excel will waste time testing decimals too. This inflates the solver time for no reason.

    1. That’s not quite how Solver works. It uses the Simplex Algorithm to to get an initial solution which, as you note, may include fractions like 0.5 even if you have specified the values must be integer. We use the simplex algorithm as this can provably solve these fractions-allowed problems. It is the most efficient way to solve these problems. We then use a search process called Branch and Bound, which itself uses the simplex algorithm, to find new solutions without the fractions. This can be slow, but can still guarantee that it will find an optimal solution. And even if it doesn’t, it can tell you how close you are to the best possible solution. Heuristics (which I also teach to my students) like Evolutionary Algorithms (and Genetic Algorithms) offer none of these guarantees, and can give arbitrarily bad solutions. So, yes, we use heuristics, but only if branch and bound takes too long. I suggest you increase the tolerance if run times take too long. Hope this helps, Andrew

    1. All non-linear solvers apart from Nomad try to parse your spreadsheet formulae (i.e. translate them into equations for the Solver). This is hard to do, and so is labelled experimental. You must have a formula that OpenSolver gets confused by. We are trying to improve our error messages, but for now, please check your formulae for anything that comes from new Excel features or uses array formulae or similar. Hope this helps, Andrew

  5. Hi,
    I am trying to run a model on a different computer with the same paths for the solver but I am experiencing the follow error:
    Error -2147220504: Unable to run the external program: “C:\Users\acartwri\Desktop\OpenSolver2.9.3_LinearWin\Solvers\win64\cbc.exe” -exit

    Let me know if there is a fix.
    Thx in advance

    1. Try running this programme directly from the command line to check you have permissions. Type “cmd” into your start bar “search” box to open a Command Prompt (or sometimes Powershell) window, and then paste in:
      “C:\Users\acartwri\Desktop\OpenSolver2.9.3_LinearWin\Solvers\win64\cbc.exe” -exit
      Let us know if this work.
      Andrew

      1. Hey,
        I have the same problem and it appears to be due to the restrictions my organization has set in Windows Security. I can run cbc.exe from the terminal without problem, but when trying to Solve the model in Excel I get an error message and a risky activity blocked notification.
        “Process blocked: EXCEL.EXE
        Blocked by: Attack surface reduction
        Rule: Block all office applications from creating child processes
        Affected items: C:\Opensolver\Solvers\win64\cbc.exe ”

        It would be great to know which Windows Security routines/rules need to be disabled in order to use the OpenSolver in Excel. Thanks!

  6. I installed open solver and the icons appeared in my excel bar at the top right. But the problem is that nothing happens when I click on any of the buttons. I’m on windows 11. Can you help me please?

  7. I keep getting the error: “subscript our of range” when trying to solve a simple non-linear model.
    I’m using COIN-OR Bonmin (Non-linear solver).

    I believe this might be a solver bug, since the default excel solver (non-linear) does find an optimized solution.

    I do need to use Open Solver since the model I’m building is much larger than the current prototype.

  8. Hello,

    I am trying to find the best sigmoid curve equation for my data. A 3-order polynomial trendline is the best that Excel can do, which results in an equation that works sort of OK near the center, but results in very inaccurate guesses once you’re reasonably far away. The data lie absolutely perfectly on a sigmoid curve, so there must be an equation that fits 100%. No matter what I do, however, I cannot get a solution that fits anywhere near as well as the equation for Excel’s 3-order polynomial trendline. I have put in constraints that keep the data between 0 and 1, and that make sure that as x goes up, y cannot go down. Every engine I’ve tried either fails or gives me a much, much worse fit per my sum of squares. Does anyone have any ideas?

    Thank you,
    nibiyabi

  9. Dear;

    I Just Installed Opensolver Addin.
    I used it for a problem of maximizing of feasibility of finished products under material availability constraints.
    Our Finished Products Also Require the Production of Semi-finished Products.
    So it is a multi-stage linear problem.
    I Used The CBC Engine In Open Solver.
    The nomencalutures of our finished & semi-finished products are modeled by a large matrix.
    As a First Step – And As a Test – I Maximized the Feasibility for a Single Finished Product: I Noticed That the Calculation of Maximum Feasibility (Objective Function) Is Exact.
    But The Problem Was That The Values ​​Of The Decision Variables Are Caotic… Can You help ?

    Many Thanks.

  10. Does anyone know how to install Gurobi for the opensolver on a mac? ive downloaded the gurobi solver and got the license. but i cant seem to make it interact with the opensolver

  11. Good evening, thanks for making Open Solver – fantastic 🙂
    Is it possible to use HiGHS with OS? I see you have it listed on your Solvers page, and I have tried copying the highs.exe into OS’s ‘Solvers\win64(or win32)’ folder but it doesn’t appear in the Model->Solver Engine -> solvers list. How do I actually install HiGHS so OS can use it?
    Thanks!

    1. Ooops! That’s our mistake. We are in the process of updating OpenSolver for HiGHS, and have done the web site update but not yet finalised the code. Watch this site for a release hopefully in the next few months.

Leave a Reply

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