Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    Norway
    Posts
    2

    Lightbulb Unanswered: VB problem in Excel..

    I'm working on a optimation problem with excel and am using the solver to help me. But to further ease my work I thought about using a macro to help me. But when I recorded what I did with the solver I got an error msg. Here is what the macro recorded:


    "Sub Prodmix()

    SolverOk SetCell:="$C$20", MaxMinVal:=1, ValueOf:="0", ByChange:="$C$17:$C$19"
    SolverSolve
    End Sub"


    and here is the error msg:

    "compile error:

    function or sub not defined"

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091

    Re: VB problem in Excel..

    Originally posted by Krutselno
    I'm working on a optimation problem with excel and am using the solver to help me. But to further ease my work I thought about using a macro to help me. But when I recorded what I did with the solver I got an error msg. Here is what the macro recorded:


    "Sub Prodmix()

    SolverOk SetCell:="$C$20", MaxMinVal:=1, ValueOf:="0", ByChange:="$C$17:$C$19"
    SolverSolve
    End Sub"


    and here is the error msg:

    "compile error:

    function or sub not defined"
    Calls made to the Solver addin need to change from Solver to Solv, i.e. SolverAdd = SolvAdd, SolverOK = SolvOK etc.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Nov 2003
    Location
    Norway
    Posts
    2

    Talking

    Thanks a lot, i got to deliver my exam on Friday and my teacher didn't understand what my problem was...he's no good at computers at all. But it did work sometimes and sometimes not...but now...it works all the time, thank a lot !

Posting Permissions

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