+ Reply to Thread
Results 1 to 5 of 5

commandbutton to run solver?

  1. #1
    Registered User
    Join Date
    04-01-2008
    Posts
    10

    commandbutton to run solver?

    Is it a way to link a button in the worksheet to the solver?

    So that you can use the button to run the solver?

  2. #2
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256
    Try to record macro for the same.

  3. #3
    Registered User
    Join Date
    04-01-2008
    Posts
    10
    it wont work when i try it. I got the norwegian version of excel, and the code is the following:

    ProblemløserOk Målcelle:="$B$24", MaksMinVerdi:=1, Verdi:="0", Endre:= _
    "$B$18:$D$18"
    ProblemløserLøs

    ^ this is what i recorded in the macro when i used the solver

    the following gets highlighted in the code: ProblemløserOk . And the error msg says: Compile error: sub of function not defined
    Last edited by giraff; 04-02-2008 at 08:13 AM.

  4. #4
    Registered User
    Join Date
    06-13-2008
    Posts
    2
    I get exactly the same problem (except using US english version).

    The following macro code was generated using the record macro function in Excel 2003.

    Please Login or Register  to view this content.
    Assigning this macro to a button on the worksheet results in the following error when executed. It also generates the error when executed from the “Tools – Macro – Run” menu pull-down. It functions correctly during the recording process.

    “Compile Error : Sub or Function not defined” (SolverOk is highlighted.)

    Visual Basic help is pretty cryptic, and virtually no help.

    Can anyone enlighten me in plain English as to what’s wrong? How do I go about “defining” the Sub or Function so the dang thing will work?

    Thanks
    Last edited by Kevin_h; 06-13-2008 at 01:57 PM.

  5. #5
    Registered User
    Join Date
    06-13-2008
    Posts
    2
    Solution is on the Microsoft forum here: http://forums.microsoft.com/Forums/S...iteID=1&mode=1

    You need to use tools:references from the pulldown menu when in the macro edit screen and check SOLVER in the list of references that are displayed.

+ 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