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

  1. Hi, I used the Open Solver to find which of the numbers in a given list add up to a desired value. After I build the model and hit the “Solve” button, I always get a dialogue box that says “Model solve failed: Open Solver encountered error 9: Subscript out of range Source=opensolver”
    Although, when I hit “OK”, I do get the desired result. I do not understand why this happens. Could you plese help me with this?
    I have tried using all the versions of Open Solver but with the same problem. I am using Excel 2007 on my system.

    1. Thanks for the post. It looks like you have found a bug we need to fix. If you like to email me your spreadsheet, I will have a look at it. Please send it to a dot mason at auckland dot ac dot nz. Thanks, Andrew

  2. Hello,
    I´m trying to use Open Solver in my VBA macro.
    I used the solver VBA codes and it worked well, except the part of setting my target value.
    My code is:
    SolverOk SetCell:=”$h$39″, MaxMinVal:=3, ValueOf:=valor, ByChange:=”$F$3:$F$39″
    SolverAdd CellRef:=”$F$3:$F$39″, Relation:=5, FormulaText:=”binario”
    SolverAdd CellRef:=”$I$3:$I$39″, Relation:=2, FormulaText:=”1″
    Theres another string i need to use to do that in OpenSolver?

    Thanks
    Btw. VERY NICE add-in.. Solved me a really huge problem

    1. Eduardo: Thanks for your comment. You have found an OpenSolver bug that we’ll fix in the next release. At the moment, the Model dialog does not correctly show the objective with a ‘target’ value (as you are setting with your VBA). However, OpenSolver still internally understands the model correctly; choosing Show/Hide Model will show the target objective correctly. Solving the problem with OpenSolver should also work correctly, and so you should be able to solve your problems ok. It is just the Model dialog that we need to fix. Thanks for pointing this out to us. Andrew

      1. Hello Andrew, thanks for the quick reply

        I think I´m doing something wrong.
        After the code above, I just added “RunOpenSolver True”. But it didn´t work.
        However, after the OpenSolver returns a “no linear” error, if I just click the Solve button it works fine.
        There´s something else i need to add to my code?

        Thanks

        1. Eduardo: Perhaps if you send me the spreadsheet (if you are happy doing so), then I can look into this in more detail. There may be another issue there. a dot mason at auckland dot ac dot nz. Cheers, Andrew

  3. Hi – in my application the computation between each optimization iteration is handled via a VBA macro as opposed to an excel formula (computing 1000s of permutations) and filterint them. How can I use Open Solver in this case? I do not see an option to create a workflow where allowing the inputs to set first, then running a macro before finally reading the output cell. I guess, the macro could call on the appropriate OpenSolver Sub(s) to do so – if the case, can you tell me what sub to call (in order) and parameters to pass?
    Hope it is clear… let me know – I could nto find an example on the site.
    Best Regards!

    1. I’m not quite sure what you mean by “optimization iteration”. However, if you are using VBA, then look at the VBA in OpenSolverMain under RunOpenSolver to see how to run OpenSolver. But, are you wanting something more complicated where you change the model (in a way that requires constraints to be added or removed) and then run OpenSolver again? Do you have a working example using Solver? Andrew

      1. Andrew – yes, you are right, I need to get into your VBA code and understand it. By iteration, I meant everytime the optimizer assign new input variable values during the optimization process. I will not change constraints during the process -but the VBA takes 20s to ouptut the results (one being the variable to minimize). I do not have a working example yet. For now, I am automating this workflow using a commercial code but want to have everything within Excel in the future.

        1. Fred. It sounds as though you are repeatedly solving slightly different versions of the same LP/IP model. If you are changing the constraint right hand side values, then using the Quick Solve feature will dramatically reduce your run times. To use this, you define the cells (termed ‘parameters’) that you will be changing between runs (with the menu item Define Quick Solve Parameters), and then build the model (using Initialize Quick Solve). Then, you can just change the parameters, and click the Quick Solve button to get the new optimal solution. This only works if your parameters change the right hand side values and nothing else in the model. Will this be helpful for you? Andrew

  4. Hi there! I was testing the OpenSolver1.4 and the following message appeared: “model solver failed: the cbc solver did not create a solution file no new solution is avaiable”. When I try the the previous version (OpenSolver1.3), the problem is solved normally. PS: Windows 7 x64 and Excel x64.

    Att.
    Val

    1. Val, You are the second person to report this. This is caused by the new CBC version which needs more DLL’s. We are making progress on fixing this! Thanks for drawing our attention to this. Andrew

      1. att. Andrew Mason.
        dear Andrew,
        I received the message that the cbc program could not be executed because the required MSVCP100.dll file was missing ….. (is this a Microsoft Visual Studio file ?). Hope that might help.

        Regards,

        Daniel.

  5. Hi,

    When I click solve button on OpenSolver 1.4, I always get this message:

    “Model Solve Failed: The CBC solver did not create a solution file. No new solution is available.”

    Regards,

    1. Not yet. However, it should not be too hard. The OpenSolver code needs to be tweaked to replace the Windows-specific code to run CBC with similar Mac code, and a Mac version of CBC needs to be compiled (or created – does it exist?). Are you perhaps keen to look into this? Andrew

  6. First of all, thank you for making OpenSolver! It has been quite helpful to me in my work this summer. However, I am trying to solve a very lsrge problem (70080 variables) and it appears OpenSolver has run out of memory. Are there any ways to increase the amount of memory OpenSolver can utilize or will I have to seek an alternative solution?

    Thanks!

    1. We have solved problems that large with OpenSolver. If you like to send me your spreadsheet, I can have a look. Please send it to a # mason @ auckland # ac # nz, where #=. Cheers, Andrew

  7. Congratulations!!! FANTASTIC!!! It’s very easy, faster and more precise than Premium Solver

    last week i was running standard solver in Excel 2007…. 14 hours of processing… with OpenSolver…. only 1 (one) minute!!!!!

    Thank you very much…!!!
    Cristian
    from Chile

    1. VBA projects have the source embedded in the Excel extension; open OpenSolver and then press ALT-F11 to open up the Visual Basic for Applications environment.

  8. Hi Andrew,

    Thank you very much for this mammoth efforts to create this fantastic application!
    It helped our organization to solve Mixed Integer Linear Programs of around 5000 variables and 6000 constraints very quickly, without buying premium solver. Also, it is very easy to integrate it with Excel’s existing solver and also to automate in VBA. I found that OpenSolver always provides as good solution as premium solver and sometimes produces even better solutions, that too with considerably less time and memory usage.
    Once again, thank you very much!!!!

    1. Hello Ashwin,

      I am trying to do the same. Can you please help me in that. Is it possible to import a lp file to the opensolver? Also can you please send me the model.

      Thanks!!

    2. Hello Ashwin,

      I am trying to do the same. Can you please help me in that. Is it possible to import a lp file to the opensolver? Also can you please send me the model.

      Thanks!!

  9. Hello there! I have made a spreasheet with 41680 variables and 10267 constraints, the OpenSolver found the optimal solutions but it´s very important for may research to know exactly how much time it takes to solve the problem. There is any chance to trace the time?

    Att.
    Valdecy

    1. Val, pleased to hear that OpenSolver worked for your large problem. What sort of problems are you solving? OpenSOlver will write out to the .lp file the time taken to create (not solve) the model. This might be useful. Using OpenSolver’s menu, you can also open the last model in CBC, and then enter CBC commands to solve the problem. CBC may be able to give you solve times. ALternatively, you can modify the OpenSolver code. I look forward to hearing how you get on. Andrew

      1. Andrew,

        I´m solving cutting stock problems (http://en.wikipedia.org/wiki/Cutting_stock_problem), to be more exactly, I’m solving a specific model that generates the cutting patterns. It´s a NP-Hard problem, and OpenSolver is a very good tool to find optimal solutions without using heuristics. I´ve written an article about this problem and cited the OpenSolver 1.2. If the reviewers accept the article (I hope so!!! Prayers, I need Prayers…LOL) I will post a link here. I´ll give a try with the CBC commands, it appears more easy…

        Val

  10. Hi Andrew,

    I am currently using Open Solver for my thesis and I am calling the open solver from VBA. I need to iteratively find solutions for different data sets. So for some of the data sets there aren’t any feasible solutions. So when such a data comes up I have to manually press OK for the dialog to close and the program to continue reading my other inputs. Is there a option in OpenSolver to suppress these dialog boxes when an infeasible solution comes up. (using VBA)

    Appreciate your time.

    Thanks,

    Aswinraj

    1. Aswinraj, There is no such option. I suggest you modify the OpenSolver code to track infeasible results. I’ll add this to our ToDo list! Can I ask what problems you are solving for your thesis? Andrew

  11. There is any possibility to build an OpenSolver version for MS 2010 x64? Or we can workaround somehow….

    Att.
    Val

    1. Val, I would have expected OpenSolver to run in 64 bit windows. The VBA should work, and Windows should be able to run the 32-bit CBC. What is the problem? Andrew

      1. When i try to install Opensolver on MS Office x64 the following message appear:

        “Compilation Error:

        The code for this project must be updated to use in 64-bit systems. Review and update the statements, Declare, and then mark them with the attribute PtrSafe.”

        Att.
        Val

        1. Val, It looks like OpenSolver will need updating at some point. However, Microsoft say here that “In a default installation of Office 2010, the 32-bit version [of VBA] is installed, even on 64-bit systems. You must explicitly select the Office 2010 64-bit version installation option.” I assume you have done this “explicit selection”, and that’s why OpenSolver is not working? It is working fine for us in Windows 7 64 bit running Office 2010. Andrew

    2. Val, Pleased you got OpenSolver working under 32 bit VBA. We now have a version that works under both 32 and 64 bit versions of Office; this will be released soon. Thanks for alerting us to this. Andrew

    1. If you like to email your spreadsheet to me, along with a description of what causes the error, I will have a look at it. a dot mason at auckland dot ac dot nz. Cheers, Andrew

  12. I’ve used this for a scheduling problem that I’ve encountered. It had tons of variables that the default add-in couldn’t handle but open solver could! Great work guys!

Leave a Reply

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