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.

As of July 2025, there are two known issues caused by Microsoft code changes. These are a RefEdit issue that breaks the Model dialog (see #6 below; a user can easily fix this) and a DLL access change that impacts NOMAD (see #10 below; fixing this requires editting VBA code).

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’ and ‘Compile error: variable not defined’: Missing Reference & Blocked ActiveX RefEdit Errors (updated July 2025)

July 2026 update: OpenSolver uses the ActiveX “RefEdit” control.  If this is not accessible, then you may get a “compile error: variable not defined” error (at a line containing “refObj”) when you open the Model dialog. I have also had a “Run-time  error -2147352573 (800200003)  Could not find the specified object” occur when clicking the “Model” button.

According to StackOverflow, the default setting in Excel has recently changed to a stricter level and this disables controls from external libraries like RefEdit. So, in recent Excel versions, permission to use ActiveX controls must be turned on in the Excel Trust center. To do this, use File…. Options… Trust Center… Trust Center Settings to select “Prompt me before enabling all controls with minimal restrictions” (with “Safe mode” turned on); see this screenshot. (Thanks to jkpieterse for replying on StackOverflow with this information, and for Ziad for sharing the settings that worked for them.)  It also works for me selecting the slightly safer “Prompt me before enabling Unsafe for Initialization (UFI) controsl ith additional restritions and Safe for Initialzatrion (SFI) controls with minimal restrictions”. Note that this change also causes Frontline’s Solver to crash with the error “Solver: An unexpected internal error occurred or available memory was exhausted.”

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.

10. “About OpenSolver” menu crashes; NOMAD crashes (updated July 2025)

July 2025: A recent update to Excel has blocked access to the “OpenSolverNomad.dll” file that we use to execute the NOMAD solver. Symptoms of this include the “About OpenSolver” window crashing with an error: Run-time error: ’53’: File not found: OpenSolverNomad.dll
(This error occurs even though OpenSolverNomad.dll is located in the Opensolver folder under Solvers/win32 and Solvers/win64.) OpenSolver Errors also occur when trying to use the NOMAD solver.

These errors occur because Microsoft have restricted Excel’s access to DLL’s (which is what we use for Nomad). To fix this in OpenSolver you need to edit the code. (We will release a fix at some stage.) For more information, see this Microsoft Community post (also available locally). One of our users, Ed, says “I can confirm that adding the full path in the [NOMAD DLL] declare statement works”. See also this StackOverflow post.

Note: This has been confirmed for “Microsoft® Excel® for Microsoft 365 MSO (Version 2507 Build 16.0.19029.20136) 64-bit” installed as part of “Microsoft 365 Apps for Enterprise” on 12 Aug 2025.

2,231 thoughts on “Help”

  1. Hi,

    im new to linear optimization with the OpenSolver and have some problems/questions:

    How do i put constraints on the variable cells if i want them to be lets say one of two specific values or between two specific values if i have alot of variables (like 500+)? The only way i could think of involves “if formulas”, but they are not linear and not solvable by OpenSolver?
    Also i dont know how to put a constraint that the maximum of a accumulated volume should be not higher then a given value, because this would involve a “max formula”, which isnt linear again.

    Would appreciate your help!

    Cheers
    Ro

  2. is there a way to completely delete a model for a given spreadsheet and start from scratch (rather than adjusting constraints, variable cells, objectives?

        1. Hi,
          Can you expand on this. i am having the same issue and can’t find how to delete a model from a worksheet.
          Thanks,
          Gil

  3. is there a way to erase a model for a given worksheet so that I can start fresh? I’ve noticed that I’ve slowed down the calc time drastically by moving around inputs after I develop the model.

  4. Hi Andrew,
    I have 2 questions. 1) Is it possible to see the comment that appears on the screen right before you see the result again?

    2) In my model all my decision variables were set as binary type . then I added a number of decision variables as integer type to the previous model. and after I ran the new model the result have decimal points such as 1.25,… for both binary and integer type variables!

    Can Opensolver disregard its constraints? I wanted binary and integer output but it just decided to give me decimal ones?
    My maximization objective function has grown 10 times as a result of making binary variables decimal.

  5. This is a great tool, thank you for publishing. When I ran the tool the first couple of times, it seemed to go very quickly. However, then I tried to “break the tool,” essentially testing it’s limits and made my model 15x bigger before running the tool again. The tool came up with a solution, which actually surprised me and the solution made sense, but it took 90 minutes to run, which did not surprise me given how big the model was. The problem now seems to be though that the solver takes a very long time to run, even on my initial model. It used to take less than a minute to run and now takes nearly 15 minutes to run, and I did not make any changes to my original model. Any suggestions to improve speed? Thanks!

  6. It is Zoha again with another question. My model use to take 90 minutes to run. now more or less the same model takes forever and I have to just cancel it AFTER 15-20 hours. not sure what i have done to it but it might be an option I changed or checked. Could you tell me about the option ( Maximum solution time seconds). Should it be 99999999 as the default value. Right now what I have in is 99999999 which will take over 3 years! should I reduce the time to say 999secs? also I checked the ” show optimization progress while solving” hence I see that when the cbc window keeps running after a few hours it has already reached the optimal solution or the solution I use to get from it but it just keeps running and adds lines to the cbc window and the next line I see on CBC seem to have the same optimal solution. I should add that my tolerance is at 0%. however i have tested it running only slightly longer with the 0% tolerance in.
    Thank you once again for helping me out.

    1. Hard problems take a long time to solve to optimality and then prove this (which is what you see CBC doing, but remember it may find a better solution if you keep waiting). You can limit the run time directly or by increasing the tolerance; you have to decide what quality of solution you are prepared to tolerate. Andrew

  7. Hey,
    is there any document, user manual or something to talk more in detail about this solver (same question for solver studio)

    thank you,

  8. Hi Andrew,

    I have an LP model which works great except for a few occasions. The problem occurs when my input parameters have many decimal points e.g. 8.92323245123.
    Opensolver returns an infeasible message.

    I think its because I have a couple of hard constraints. So for example 1.00000026 1
    Let me know what you think.

    Thank you for your help!

    1. I suggest you change the right hand side values of the constraints (eg increasing them for <= constraints) to become feasible. Andrew. PS: Knowing anything in this world to 11 decimal points is pretty amazing!

      1. Haha.
        I’ll make the changes and let you know how it goes.

        Also, is there a setting that I can make in opensolver which limits the number of decimals places for the decision variables. Thanks.

  9. To make Open Solver always in Windows 7 with Office 2007, Excel wanted the files at

    C:\Users\”username”\AppData\Roaming\Microsoft\AddIns

  10. When I try to install, I get the message “Object Library invalid or contains references to object definitions that could not be found”

    I tried this several times and still get the same message.

      1. No Luck. Diagnostics dis not find anything. I also tried Alt-F11 to get to VBA but I can’f find where I’m supposed to uncheck the MISSING: RefEdit

      2. No Luck. Diagnostics did not uncover anything. I tried going into VBA but I’m not sure where I need to go to uncheck MISSING:RefEdit.

  11. Hi all, I try to run OpenSolver via VBA. In my worksheet I referenced to openSolver, then wrote a sub to execute the function (Sub GCM_1 () – RunOpenSolver False – End Sub). Now, when I execute that, I get the error msg “Error in compiling: Variable or procedure expected instead of project” (this is translated from German ;-)), referring to the line “Set OpenSolver = COpenSolver” in the Function code. Can you help me out? Thank you!

  12. Hello,

    I’m suddenly having trouble with Open Solver at launch. When I select the ‘model’ option in the Excel ribbon, I receive error ‘1004’: Application-defined or object-defined error.

    The debugger points to a line in the GetNameValueIfExists Function in the OpenSolverModule. Specifically, the error occurs at:
    Set NM = w.Names(theName)

    Anyone ever encounter this? Peculiar because it used to work…

    Cheers,
    Craig

    1. I assume the error is on the lines:
      610 On Error Resume Next
      620 Set NM = w.Names(theName)
      This should never give an error because of the “on error” line; very odd. Does it crash for a new blank spreadsheet? When it gives the error, can you hover over “theName” to see the value in this variable? Thanks, Andrew

      1. Hi Andrew,

        Thanks for the quick reply.

        Those are the correct lines – and I had the same thought about the error handling. And yes, this occurs on a blank spreadsheet. The value in the variable is “Sheet1!solver_drv”

        This name is constructed in the SetAnyMissingDefaultExcel2007SolverOptions() sub – that’s as far as my audit took me.

        Any thoughts?

        Thanks!
        Craig

      2. Hi Andrew!

        No worries – definitely an Excel problem – thanks so much for your help.

        I’m not sure how or when, but in the VBA Window Tools->Options->General->Error Trapping – the setting had been modified to “Break on All Errors”

        Switched back to Break on Unhandled Errors and all is well. Relieved!

        Cheers,
        Craig

  13. Hi Andrew,
    Once again thank you for your helpful comments
    I am successfully running my model with over 700 variables and a few thousand constraints now. It takes 90 minutes to run. My logical constraints seems to have been met and the result looks alright except for one this:

    when I change the right hand side of my labor constraint say from 400 to 1000 the value of my maximizing objective function drops a little bit from 23,900 to 23,800. in the case of 400 the labor constraint left hand side stops at 346 and when I set the limit to 1000 it stops at 342 so they are both non binding too…. Do you think there is an explanation there. are there settings that can differ on various runs of the model. Not sure where is the best place to look for error

    I should add I ran versions where labor was binding I started from 50, then 100, then 150 ,….. and each time the objective function improved only when I became non binding instead of staying the same it started dropping. Let me know if I haven’t explained well. Thank you very much.

  14. Hi Andrew,
    I asked you some days ago about an eventual binary variables limit. I want to specify That i had integer solution With LP so not really “hard” but infeasable with IP with an error msg “cbc stopped working”
    Thanks

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.