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.

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.

Common Problems

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.

1,408 thoughts on “Help”

  1. Hi, my problem is about “Unable to delete the file”

    The screen displayed “: C:\Users\刘兆邦\AppData\Local\Temp\”. And I do not have the log1.tmp.

    Opensolver had worked last week. But this week it is not working.

    Could someone help me to fix this?

    Thanks

    1. I suspect that VBA won’t like the non-English characters in that path. But that should have been true last week as well (unless you have changed the logon name?). If the file is open, then re-booting may allow OpenSolver to delete it. Please try re-booting first, and then loggin on with another user name; please let us know how you get on. Andrew

  2. Hi,
    I’m trying to optimise the choice of a PLC and it’s modules based on price. There are 3 types: one that doesn’t support additional modules, one that supports 2 and one that supports 8. I’m trying to add a variable that if “activated by user” B13 (1 or 0) that forces the optimisation to leave room for at least 1 more module.
    I’m getting this error:
    “…The model contains ‘AM14=1’ for which instance 1 does not depend on the decision variables and is not satisfied.
    Constraint specifies: LHS=AM14=1 = RSH=1=2…”
    I don’t get why at RSH is says 1=2.
    And i have configured this function AM14=IF(OR(AND(B13=1,AM10>AM52),B13=0),1,0) where B13 is my input, AM10 is max configurable modules and AM52 is currently configured modules (both are automatically calculated). The constraint is AM14=1.
    The constraint depends on the input since the curent number of modules configured depends on the variables. What am I doing wrong?

    1. This is not a linear model, sorry. Try Googling “MIP formulations”. Good luck, Andrew

    1. Yes free to use. It is under the GPL and so any changes to our VBA code need to be shared in source code form if you publish/sell the modified code. Andrew

  3. Hello,

    How can I define soft and hard constraints using Opensolver?
    My model have 3 constraints, but two of them should be hard constraints to obtain more realistic solutions even extremes scenarios.

    Opensolver is a great tool. I hope to learn how to use it well.

    1. Add slack and surplus variables with costs. E.g. a + b <= 5 becomes a + b <= 5 + c where c is costed in the objective. Hope this helps. Andrew

  4. Hello Andrew.

    Since I asked you about how to get an information from Opensolver.

    Andrew Mason (Team OpenSolver) says:
    May 13, 2017 at 9:06 am
    If you view the log files you will see this info. You may want to get more output from CBC by passsing it extra solver options, which OpenSolver lets you do. Andrew

    Do you mind If I ask you for more explanation about how to get more output from CBC by passing it extra solver options.

    Thank you
    Panu

  5. Hi, I am evaluating solvers for my business.

    Our Excel spreadsheet is a non-linear, non-smooth model that simulates the technical and economic performance of a concentrated solar power station. The spreadsheet has approximately 700,000 calculation cells and around 60,000 of these use iterative calculation.

    Our solver model complexity is dependent upon the objective being evaluated, but generally speaking it is not very “large” with usually between 1 and 10 variables and less than 100 constraints.

    Can you let me know whether OpenSolver can handle this type of model ad which engine in OpenSolver you would recommend.

    1. Thanks for your enquiry. I’m not quite sure I understand your model, but if it uses iterations as part of the model equations, then it won’t work in OpenSolver with the linear and non-linear solvers, except perhaps with the exception of NOMAD (which tries to solve just about any spreadsheet without ever building a separate model). Hope this helps. Andrew

  6. Hello,
    My colleague ran into an issue with OpenSolver – it creates cbc.bat, fills it with the correct path and parameters, but refuses to start cbc.bat from the default location (%temp%). The same cbc.bat runs ok from the %temp% either via cmd.exe or doubleclicking. I tweaked with the VBA code and it seems to start, if manually pointed to another folder (like “C:\Temp\cbc.bat”).

    CreateProcessA function just fails by itself (so no log is created), LastError is 5, that is ACCESS_DENIED. I double-checked the ACLs on %temp%, the effective rights, even added the Everyone with Full Access, but the issue is still there.

    What can be the cause? What else can I try besides substituting %temp% with another folder straight in the code?

  7. Hi, i am solving a lot of small MILP programs using VBA macro with

    Application.Run “OpenSolver.xlam!RunOpenSolver”

    and some for cycles. When there is one infeasible program, there is a need to click ok to go to next program. Please, is there any possibility to run a test of feasability before this application.run? It would help me a lot, because the whole calculation takes about 5 hours and i have to be next to computer for the whole time 🙂

    Best Regars, Jiri

    ps: i am calculating dissertation thesis theme with opensolver and i am really glad, that this project exists, it helps me a lot ..

  8. Good evening! I have a problem. I couldn’t find answer to my question on the Internet.
    I have an optimization task with objective function and constrains. I used function in OpenSolver “View Last Model Lp File”, but in file “model.lp” all coefficients are numbers, but I need formulas in coefficients of objective function and constrains, for example:
    1. Obj: +36714.2857142857 B3 +36714.2857142857 C3 + …
    So I need Obj: + (N3+O3*P3) B3 +(N3+O3*P3) C3 + …
    2. SUBJECT TO
    -0.2 B3 -0.1 B4 -4.99999999999999E-02 B5 +0.05 B6 -0.2 B7 -0.3 B8 -0.4 B10 -0.2 B11 -0.1 B12 -0.1 B14 -0.3 B15 -0.2 B16 +0.1 B17 -0.1 B18 -0.2 B19 >= +0
    Consider the first coefficient for constrain:
    -0.2 B3+ … >= +0
    I need
    (M3-F23)*B3+ … >= +0
    Do you have special program for reports as “model.lp”, but with formulas? I will be very grateful for your help.
    Thank You in advance.
    Best regards, Elena

    1. The .lp file format does not contain Excel formulae, but the results of those formulae as they are used to compute the coefficients you see. There is no formulae view apart from the sheet itself. However, some of our (still experimental) non-linear solvers write temporary files which may be useful; you can find these by locating the OpenSolver temp folder, under “View all OpenSolver files”. Try solving using NEOS, and then hunt through the files we create. Cheers, Andrew

  9. Hello, congratulations for the excellent job in the OpenSolver project. It helps me a lot in my degree projects.
    Usually I calculate my models using small to medium problems, but recently I had the need of calculating lager and bigger problems.
    I noticed that the CBC solver, even working on 64bit uses only 10 to 15% of my CPU potencial. And it’s not using all the cores either.
    How can I do to make the CBC solver to use the full potencial of my machine??

    Thank you for the help.

    Bruno.

    1. Cbc comes in single threaded mode by default. You will need to compile it yourself to create a multi threaded version. Andrew

  10. Hi,

    I’m using open solver to solve an optimization problem. The problem is as follows:

    Suppose I’m optimizing input with given total cost constraint and input availability. We have input cost and want to minimize the cost. The another constraint is the optimized input falls in any of the set value, say input11, input12, input13 and input14. This discrete input range varies across inputs.

    So we have 3 constraints:

    budget,
    input capacity for each inputs and
    inputs should fall within any of the falling four options.

    The code I’m using is the following:

    Sub TestOpensolver()

    Dim TestSheet As Worksheet
    Set TestSheet = Worksheets(“Optimized_Results”)

    OpenSolver.ResetModel Sheet:=TestSheet

    ‘Objective Definition
    OpenSolver.SetObjectiveFunctionCell TestSheet.Range(“AC3”), Sheet:=TestSheet
    OpenSolver.SetObjectiveSense MinimiseObjective, Sheet:=TestSheet

    ‘Variables Definition
    OpenSolver.SetDecisionVariables TestSheet.Range(“AK3:AK8”), Sheet:=TestSheet
    OpenSolver.SetDecisionVariables TestSheet.Range(“AQ3:AR8”), Sheet:=TestSheet

    ‘ Constraints

    OpenSolver.AddConstraint TestSheet.Range(“AK3:AK8”), RelationLE, TestSheet.Range(“W3:W8”), Sheet:=TestSheet
    OpenSolver.AddConstraint TestSheet.Range(“AK3:AK8”), RelationGE, TestSheet.Range(“X3:X8”), Sheet:=TestSheet

    OpenSolver.AddConstraint TestSheet.Range(“AS3:AS8”), RelationLE, TestSheet.Range(“AT3:AT8”), Sheet:=TestSheet

    OpenSolver.RunOpenSolver , False

    End Sub

  11. Hello,

    I have follwed the process described to install OpenSolver but I still the below error when trying to use it. Any suggestion or help would be highly aprreciated.

    Thanks for your help.

    Error message :

    17 May 17 16:42:45 [OpenSolver.xlam] OpenSolverIO.CreateScriptFile: Line 3
    17 May 17 16:42:45 [OpenSolver.xlam] CSolverCbc.CreateSolveScript: Line 4
    17 May 17 16:42:45 [OpenSolver.xlam] SolverCommon.WriteModelFile: Line 21
    17 May 17 16:42:45 [OpenSolver.xlam] SolverCommon.SolveModel: Line 42
    17 May 17 16:42:45 [OpenSolver.xlam] OpenSolverAPI.RunOpenSolver: Line 11

    Error 75: Path/File access error

    Solver: CBC

    OpenSolver version 2.8.6 (2017.03.06); Distribution=Linear
    Location: “C:\Users\A41590\AppData\Roaming\Microsoft\AddIns\OpenSolver.xlam”

    Excel 14.0; build 7180; 32-bit; VBA7
    Excel product code = {90140000-0011-0000-0000-0000000FF1CE}
    Excel language: English – US
    OS: Windows 6.1; 64-bit
    Username: A41590

    CBC v2.9.4 (64-bit) at “C:\Users\A41590\AppData\Roaming\Microsoft\AddIns\Solvers\win64\cbc.exe”

    No Gurobi installation was detected. The value of %GUROBI_HOME% was not set.

    Unable to find Bonmin (‘bonmin.exe’). Folders searched:
    C:\Users\A41590\AppData\Roaming\Microsoft\AddIns\Solvers\win64
    C:\Users\A41590\AppData\Roaming\Microsoft\AddIns\Solvers\win32

    Unable to find Couenne (‘couenne.exe’). Folders searched:
    C:\Users\A41590\AppData\Roaming\Microsoft\AddIns\Solvers\win64
    C:\Users\A41590\AppData\Roaming\Microsoft\AddIns\Solvers\win32

    Unable to find NOMAD (‘OpenSolverNomad.dll’). Folders searched:
    C:\Users\A41590\AppData\Roaming\Microsoft\AddIns\Solvers\win32

    1. For some reason, you do not appear to have the permissions needed to create a temporary file. To find where the temp directory is, please open a command line (type cmd.exe and then return into the Windows Start search box), and then type “echo %temp%” without the quotes in the command lien window. Then try opening that folder and creating a file in it. Let us know how you get on. Andrew

      1. Hi Andrew,

        Many thanks for your feedback. I have opened the corresponding folder and created a file in it, which works well. However I still get the error below :

        07 Jun 17 13:56:36 [OpenSolver.xlam] OpenSolverIO.CreateScriptFile: Line 3
        07 Jun 17 13:56:36 [OpenSolver.xlam] CSolverCbc.CreateSolveScript: Line 4
        07 Jun 17 13:56:36 [OpenSolver.xlam] SolverCommon.WriteModelFile: Line 21
        07 Jun 17 13:56:36 [OpenSolver.xlam] SolverCommon.SolveModel: Line 42
        07 Jun 17 13:56:36 [OpenSolver.xlam] OpenSolverAPI.RunOpenSolver: Line 11

        Error 75: Path/File access error

        Solver: CBC

        OpenSolver version 2.8.6 (2017.03.06); Distribution=Linear
        Location: “\\u-dom1.u-ssi.net\dfsroot34000\TEAM\F\FGG\GRP\London SVP\MODELS\LNG\4. Open Solver\OpenSolver2.8.6_LinearWin\OpenSolver.xlam”

        Excel 14.0; build 7180; 32-bit; VBA7
        Excel product code = {90140000-0011-0000-0000-0000000FF1CE}
        Excel language: English – US
        OS: Windows 6.1; 64-bit
        Username: A41590

        CBC v2.9.4 (64-bit) at “\\u-dom1.u-ssi.net\dfsroot34000\TEAM\F\FGG\GRP\London SVP\MODELS\LNG\4. Open Solver\OpenSolver2.8.6_LinearWin\Solvers\win64\cbc.exe”

        No Gurobi installation was detected. The value of %GUROBI_HOME% was not set.

        Unable to find Bonmin (‘bonmin.exe’). Folders searched:
        \\u-dom1.u-ssi.net\dfsroot34000\TEAM\F\FGG\GRP\London SVP\MODELS\LNG\4. Open Solver\OpenSolver2.8.6_LinearWin\Solvers\win64
        \\u-dom1.u-ssi.net\dfsroot34000\TEAM\F\FGG\GRP\London SVP\MODELS\LNG\4. Open Solver\OpenSolver2.8.6_LinearWin\Solvers\win32

        Unable to find Couenne (‘couenne.exe’). Folders searched:
        \\u-dom1.u-ssi.net\dfsroot34000\TEAM\F\FGG\GRP\London SVP\MODELS\LNG\4. Open Solver\OpenSolver2.8.6_LinearWin\Solvers\win64
        \\u-dom1.u-ssi.net\dfsroot34000\TEAM\F\FGG\GRP\London SVP\MODELS\LNG\4. Open Solver\OpenSolver2.8.6_LinearWin\Solvers\win32

        Unable to find NOMAD (‘OpenSolverNomad.dll’). Folders searched:
        \\u-dom1.u-ssi.net\dfsroot34000\TEAM\F\FGG\GRP\London SVP\MODELS\LNG\4. Open Solver\OpenSolver2.8.6_LinearWin\Solvers\win32

        Many thanks for your help and time

        Best

        Alex

  12. How to get an OpenSolver processing time detail, maybe as a notepad or anything. I need to know about processing time, tolerance, variables, etc.

    Hope you can help

    Thank you

    1. If you view the log files you will see this info. You may want to get more output fro CBC by passsing it extra solver options, which OpenSolver lets you do. Andrew

  13. Hello,

    I’m trying to solve a MILP problem for plant and capacity allocation with 210 binary and 5 continuous variables, using Gurobi engine, but when I press “solve”, the solver highlights non-linear constraints, some of which are linearised constraints defined through IF in excel, others bound binary variables (e.g. no more than 1 plant allocated to each supplier). What could be the problem? Is there a way to indicate somewhere, that it’s a MILP and not simple LP problem? Thank you for your help!

  14. Hi. Thanks for putting the work you do into OpenSolver. I’ve used Solver and am new to OpenSolver. Two issues arose for me that I cannot find answers for elsewhere on the site.

    1. Why do you suppose I should do when the solved model displays zero for every Variable Cell? All other cells with calculations referencing Variable Cells are populated indicating they aren’t really zero.
    2. I’m getting a much lower than expected value in the Objective Cell in another model. I’m running this off an optimization template downloaded as part of a book, so it’s not a modeling error on my part.

    Thanks,
    JD

    1. You have almost certainly made a mistake; check the .lp file to confirm your model is correct. Andrew

Leave a Reply

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

*