+ Reply to Thread
Results 1 to 8 of 8

Excel Macro for running solver

  1. #1
    Registered User
    Join Date
    01-11-2009
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    9

    Excel Macro for running solver

    Hi all,

    I have a problem with a macro in Excel 2007. It invokes
    solver and creates an answer report. Please find the VB
    code for macro, below.


    Please Login or Register  to view this content.

    When I run this macro, i am getting an error "an unexpected
    internal error occured,or available memory exhausted
    ".
    When I remove the SolverFinish statement from the macro, I don't
    get this error.
    Can you please help me using the SolverFinish function here - as I need to look at the report solver generates.

    I greatly appreciate any help.
    Last edited by kodamv; 01-11-2009 at 04:22 PM. Reason: Code was not wrapped.

  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
    Welcome to the forum, kodamv.

    Please take a few minutes to read the Forum Rules, and then edit your post to wrap your code with Code Tags.
    Entia non sunt multiplicanda sine necessitate

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

    Try changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-11-2009
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    9

    Smile

    Great..Thanks for the help.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You’re welcome. Would you please mark the thread as Solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

  6. #6
    Registered User
    Join Date
    01-11-2009
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    9
    I have a follow-up question. Once I create the report with the above macro - I added some more tasks to the macro. It basically copies some cells from the report to a different sheet and deletes the answer report.

    The code looks as below.

    Please Login or Register  to view this content.
    When I run this from view macros and run it - it runs without any error. But, when I assign this macro to a button and run it gives an error 'Visual Basic 400'.
    Can you please help me understand what is going wrong?

    Thanks a lot!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You can simplify the code some:
    Please Login or Register  to view this content.
    What line does it error on?

  8. #8
    Registered User
    Join Date
    01-11-2009
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    9
    With the simplified code, it is working fine.
    Thanks a lot for your help. I am setting the status of the thread to solved.

+ 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