+ Reply to Thread
Results 1 to 6 of 6

Trying to set objective cell of opensolver on VBA

  1. #1
    Registered User
    Join Date
    01-30-2014
    Location
    Brazil
    MS-Off Ver
    Excel 2016
    Posts
    46

    Question Trying to set objective cell of opensolver on VBA

    Hello.

    I read the opensolver API and I'm trying to set the objective function and the decision variables.
    I'm using an indirect refference to the range. It is written at sheets(2), cells B3 and B4.

    Cell B3 = $C$89
    Cell B4 = $C$92:$C$94,$C$113:$C$115,$C$134:$C$136,$C$155:$C$157

    Then I used this code:

    Please Login or Register  to view this content.
    This returns the error 424, "object is mandatory".
    What am I doing wrong?

    Thanks for the attention!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Trying to set objective cell of opensolver on VBA

    I'm not familiar with OpenSolver, but remove the parens in the last two statements for starters.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    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,758

    Re: Trying to set objective cell of opensolver on VBA

    You can also build your model in Excel 2010 and run it using "OpenSolver" as "OpenSolver" can read "Excel Solver models"

    As you seem to run "OpenSolver" using VBA you must of course set a reference to "OpenSolver" in VBA and also check that "OpenSolver" has read your "Excel solver setup" correctly. Just click "Model" in order to verify.

    A macro like this should normally be sufficient to run "OpenSolver"

    Please Login or Register  to view this content.
    Alf

  4. #4
    Registered User
    Join Date
    01-30-2014
    Location
    Brazil
    MS-Off Ver
    Excel 2016
    Posts
    46

    Re: Trying to set objective cell of opensolver on VBA

    Hey, thanks a lot. I ran into other problems but you guys helped me.

  5. #5
    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,758

    Re: Trying to set objective cell of opensolver on VBA

    You are welcome.

    Thanks for feedback and rep

    Alf

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Trying to set objective cell of opensolver on VBA

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using Solver/OpenSolver to optimize NORMDIST values (Fantasy Baseball)
    By jackries in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-11-2016, 01:52 PM
  2. Using Solver/OpenSolver to optimize NORMDIST values (Fantasy Baseball)
    By jackries in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-08-2016, 03:52 PM
  3. Solver - Objective Zero
    By skyxliner in forum Excel General
    Replies: 6
    Last Post: 12-18-2015, 02:59 PM
  4. [SOLVED] Problem calling third-party application OpenSolver using VBA
    By lostest in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2015, 12:46 AM
  5. Error 424 - Objective required
    By neivaldo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2014, 01:25 PM
  6. [SOLVED] using solver to set objective to value of another cell
    By will.girling in forum Excel General
    Replies: 2
    Last Post: 11-26-2013, 10:00 AM
  7. [SOLVED] Percent of Objective
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 03-15-2005, 05:06 PM

Tags for this Thread

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