+ Reply to Thread
Results 1 to 5 of 5

calling Solver .dll through VBA

Hybrid View

  1. #1
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: calling Solver .dll through VBA

    Hi

    Cross-posting is no problem if you just add a link to the other forum where you also posted your question.

    I wasn't aware that these 2 forums are linked
    They are not but quite a number of forum members are rather active in a number of other excel forums as they have this strange craving for solving excel problems.

    Re your problem I have not seen any info about calling solver from the solver.dll file and succeeding. Why do you need to run solver in a ”normal” mode first before reverting to vba?

    Just record a macro with all settings and set a reference to solver in the vba window i.e. Tools -> References and click box for solver.

    I recommend starting the loop with the SolverReset command to avoid build up of the constraint.

    I assume you have tried running the “Simplex LP” as this is the fastest solver model.

    You could also upload a sample file then hopefully some member may have some suggestion on how to speed up the process.

    I’ve read somewhere that Excel do have problems with multitasking Excel-> Options -> Advanced find heading “Formulas” -> “Multi-thread calculations

    http://www.mrexcel.com/forum/excel-q...ore-cores.html

    Alf
    Last edited by Alf; 05-19-2013 at 06:12 AM.

  2. #2
    Registered User
    Join Date
    01-27-2010
    Location
    prague
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: calling Solver .dll through VBA

    Hi,

    The reason I do a manual run of Solver before I run the VBA is so that I do not need to reset the Solver for every iteration. So, say I have 1000 iterations, I just need to reuse the same constraints over and over again. If I were to do a SolverReset before each run, it would take even more time. Of course, I re-initialise my parameters to some fixed values before I run each Solver, so I think there is no constrain-build up that you mention. And I cannot use Simplex because my problem is nonlinear.

    Currently I do not have a sample file to upload -- the files that I am working with were not created by me, and they are huge (>10MB per file). Basically, there is this super long equation (with power laws, exponentials, trigonometry, and integration steps somewhere in between, etc) that needs a lot of prior steps to arrive at, and there are a handful of parameters that need to be optimized so that the difference between this model and some measured values are as similar as possible. As you can imagine, each run of the Solver involves easily tens of thousands of calculations. I am just hoping to cut down the run time by directly calling the dll rather then invoking the GUI-based Solver.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1