Results 1 to 5 of 5

Thread: Solver Problems

  1. #1
    Join Date
    Dec 2003
    Posts
    6

    Unanswered: Solver Problems

    I created a Macro in Excel 2002 as follows:

    Worksheets("Sheet1").Activate
    SolverReset
    SolverOptions Precision:=0.001
    SolverOK SetCell:=Range("$b$4"), MaxMinVal:=1, ByChange:=Range("$e$6")
    SolverSolve UserFinish:=False
    SolverSave SaveArea:=Range("A33")


    When I run the Macro I get the following message:
    "An unexpected internal error occurred, or available memory was exhausted."

    Please , how can I get around this?

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    I don't have access to my computer right now, but I think it has to do with how you are accessing Solver.
    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
    Dec 2003
    Posts
    6

    Running Solver Macro in Excel from Access

    For some reason it now works when I run the Macro in Excel. However when I call the Macro from Access I get the same message as before.

    With objXl
    .Visible = True


    Set objWkb = objXl.Workbooks.Open(wname)
    Set objSht = objWkb.Worksheets(sname)

    With dataset
    k = 1
    .MoveFirst

    Do While Not .EOF

    With objSht

    .Cells(k, 1) = dataset!code
    .Cells(k, 2) = dataset!descrip
    .Cells(k, 3) = dataset!num

    End With

    k = k + 1

    .MoveNext
    Loop
    End With

    .Application.Run ("Macro1")

    End With

  4. #4
    Join Date
    Oct 2003
    Posts
    1,091
    I would suggest that the best place to get more information/help on Solver is this site:

    http://www.frontsys.com/mlvbaref.htm
    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

  5. #5
    Join Date
    Dec 2003
    Posts
    6

    Solver problem solution

    Thank you for the link.


    I have solved the problem by inserting the following line in my Excel Macro. I can now run this Macro from Access.

    Application.Run "Solver.xla!Auto_Open"

Posting Permissions

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