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. I am trying to link external processes to the excel solver. The external code uses a data file as input and creates a data file as output.
    Managed to wrap this process into an excel function that works as a one off function, but, the Excel solver, it produces errors.

    Can opensolver wrap external processes into a optimazation problem?… still reading commments on the website.

    Thanks for any tips or guidance.

    mark

  2. Hi,

    I downloaded the package and extracted the files. When I press any button on OpenSolver I received the following error: “Can’t find project or library”. What could it be?

    1. I have not seen that error before. Please try moving the OpenSolver folder into another location (eg program files), and trying again. Or try repairing Excel using Excel’s built-in self repair tool. You can also check the RefEdit control is installed properly; search for RefEdit on this site for more info. Please let me know how you get on. Andrew. PS: What version of Windows and Excel are you running?

      1. Hi Andrew,

        I think that I solved the problem. The problem was in my VBA references. I would like to ask you, how much integer and binary variables can I use in the model?

        Thanks

        1. Do you mind describing what you fixed in your VBA references? Others might find it useful. There is no limit on the number of variables (of any type) other than memory and your patience waiting for it to solve! Andrew

  3. Hello,

    somehow my model doesnt work anymore. I get following error message:

    OpenSolver encountered error 1004:
    ‘Calculation’ for Object ‘_Application’ failed(at line 19540)
    Source = OpenSolver, ErrNumber=1004

    I hope you understand the error message, because my Excel error message is german and i didnt know the proper translation for it 😉

    Can you help me with this problem? Many thanks in advance

    1. Please email me your spreadsheet to email hidden; JavaScript is required, and I will have a look. Thanks, Andrew

      1. hi. i also encountered the same error message… what are the possible causes of this kind of error? is it because the model is too large? by the way, what’s the maximum number of variables that open solver can handle? thanks

  4. Hi, thank you so much for your awesome program. its helping me so much with my project.

    I’m however facing a difficulty when i am trying to add a constraint A1<A2 and A1 has formula: =SUMPRODUCT(–(AS$4:AS$1039),–(ISNUMBER(SEARCH("Mixing",$D$4:$D$1039))))
    I get the error notification: "the formula or value on the RHS is not valid, please try again"
    i learnt that Solver does not work with Sumif, which was why i converted to sumproduct but still its having problem.Can you please help?

    and thanks again for the great work!

    1. Thanks for your feedback. Solver works fine with sumif, as long as the “if” criteria do not depend on the decision variables. I suspect your formula is either non-linear, or giving an error of some type. Sorry I cannot be of more help. Andrew. PS: If you wish to send me your sheet, then I will use it as part of my task to “add better error checking for invalid RHS”!

      1. Hi Andrew,
        thanks, i will send you a copy of my spreadsheet for your review.
        I have another question. whenever i copy a sheet, the model doesnt seem to work, the error message is “A model was found on the sheet but the decision variable cells () could not be interpreted. Please redefine the decision variable and try again.” How do i solve this? I copy the sheet so that I can create different sheets for different variables.

  5. I know I read a comment about this from a year ago. But I was wondering if there had been any progress on open solver for Mac. Thanks.

    1. No, sorry. This is not something we’ll be doing, but we’d welcome a volunteer to undertake this work. Please contact me (email hidden; JavaScript is required) if you are interested in doing this. It should not be a big task, I hope. Andrew

  6. I’ve just installed open Solver and I can’t get it to work.
    I’m trying to solver a MIP problem with 200 binary variables, but the solver doesen’t even run.
    I’m using Windows 7 and Office 2010.
    “Open Solver encountered an Error:
    Unable to run the external program: C:UsersJuan PabloDesktopOpenSolver21cbc.exe – directory
    C:UsersJuanpaAppDataLocalTemp – import model.lp -ratioGap .01 -seconds 60 -solve -solution modelsolution.txt (at line 12230) (at line 19540)
    Source=OpenSolver, ErrNumber=-2147220500

    Any ideas? CBC.exe is not blocked …..

    1. I don’t have Windows 7, sorry, but I gather it can block files on the desktop. Please try moving the OpenSolver folder to a new location (such as your documents, or even your Program Files folder), and then please let me know if that works so I can let others know. Thanks, Andrew

  7. Hello Andrew! I Have a very large DEA Model (92 DMUs) that I wish to run with opensolver. I have used the following commands in VBA:

    For unit = 1 To 50
    Range(“H3”) = unit
    SolverSolve UserFinish:=True
    Range(“N” & 5 + unit) = Range(“H” & 5 + unit)
    Next unit
    End Sub

    What command I should write to substitute “SolverSolve UserFinish:=True” ?

    Best Regards!
    Valdecy

    1. Please see the “Using OpenSolver” pages at http://opensolver.org/using-opensolver, under the VBA section. Your model will run many times faster if you use the Quick Solve feature, described briefly on the same page. (See also the OpenSolver VBA source for code that uses Quick Solve.) Cheers, Andrew

  8. Hello – is there a limitation to the number of variables? I am getting the following error: OpenSolver encountered error 1004: The specified value is out of range. (at line 23520) Source = OpenSolver

    Thank you!

    1. There is no limit. Are you able to send me your spreadsheet so I can see what the issue is? email hidden; JavaScript is required. Thanks. Andrew

    2. This occurs because of a limitation in Excel limiting the size of the rectangles added to a sheet to highlight a cell range when showing a model. I will add fixing this to our to-do list. Thanks for the report, Andrew

      1. Hi Andrew,

        Thanks for your work. Dont want to be a pain but was this limitation issue fixed in the November release or is there an estimated date for it?

        Thanks a lot

  9. I am trying to include more than one set of variable cells in the “Variable Cells” section of the model but unfortunately it does not allow me to utilise a comma “,” to separate the different cells. For example I would like to include:

    $Z$166:$AH$182, $Z$169:$AH$182

    However it ignores the comma when i try and select the cells. Is there a way around this?

    1. Your ranges overlap in your example, which seems odd. Ignoring that, hold down the Control key to add a second range while dragging on cells in the sheet. Hope this helps. Andrew

      1. Suspect the problem may be with running windows on a mac with VMware. The control key doesnt seem to work, but have typed the second range and is working. Many thanks for your assistance.

  10. Hi,

    Thanks for this excelent tool. I have a question, I have a model, I need to change a parameter in case the model would be infeasible. What is the best way to do this throught a Visual Basic code?. I mean I need something like…

    run model
    if model is infeasible
    change a paremeter
    and run model again.

    I should use the visual basic commands for solver or i should to using vb directly with open solver?

    1. Can you include this parameter in your model as a decision variable with a penalty cost. If not you could use the Quick Solve feature with VBA code to repeatedly solve until you are feasible. or use Pulp or ampl in SolverStudio. Hope this helps. Andrew

  11. first thank the work they have done. is there a way to show me the number of iterations and the time it takes to find the solution of the model.
    Thanks.

  12. First and foremost thank you for the awesome work. Is there a way that I can set up solver to provide me with the 3 best possible solutions instead of only the best? This could be as simple as changing the setup on my spreadsheet, which I can send to anyone who can help. Just curious if this is an option that needs to be selected, a constraint, or just how the data is set up on the spreadsheet.

    Thanks

    1. You can add what I call a “deja vu” cut which forces a new (2nd best) solution to be found. Have you got binary variables? If so, these cuts are easy. Eg, if you get an optimal solution with x1=1, x2=0, x3=1, then add a cut (x1-1)+x2+(1-x3)>=1, i.e. the number of changes from the old solution must be >= 1. Hope this helps, Andrew

  13. Hello,

    I have just downloaded OpenSolver 2.1 from SourceForge (OpenSolver21.zip), however if you open ‘OpenSolverMain’ in VBA the version number is 1.9 with a release date of 2011/12/5.

    Is it possible to get hold of Version 2.1 from somewhere? I can’t see any obvious links on this page ‘http://opensolver.org/archives/410’

    Many thanks,
    Adam

    1. Adam: I think you are running an old version of OpenSolver, not the new one you downloaded in the OpenSolver21.zip. Make sure you extract all the new files into a folder, and then open the OpenSolver file from this folder. Hope this helps, Andrew. PS: You may need to uninstall the 1.9 version from Excel; some versions of OpenSolver let you do this from their “About OpenSolver” dialog, or you can do this using Excel’s Add-in manager.

  14. Stack ID MN Ratio Tons
    1 46 5.5 300
    2 45 4.8 300
    3 53 5.8 500
    4 52 6.2 1500
    5 45 5.2 400
    6 46 6.2 500

    Parameters MN>=46,Ratio>+5.5 Product1
    MN>=46,Ratio>+5.0=46,Ratio=46,Ratio<5 Product3
    How can I optimize the different products by combining the different stacks to get a maximum tonnage output for a specific product,i.e product1?

  15. Hello Mr Mason

    Is it possible that the variable cells be composed of many disjunct ranges, such as A1:C4;D7:G11 for example ?

    Thanks

Leave a Reply to Jordan Dant Cancel 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.