+ Reply to Thread
Results 1 to 5 of 5

VBA and solver addin Compile Error

  1. #1
    Registered User
    Join Date
    09-22-2009
    Location
    Cornwall, England
    MS-Off Ver
    Excel 2010 (Work) O365Home (Home)
    Posts
    94

    VBA and solver addin Compile Error

    Hi Guys

    I am trying to implement the solver addin using VBA. I am completely unfamiliar with this so i have started by recording a macro just so that i could see the structure of the code and the "key words"

    I recorded the following macro,

    Please Login or Register  to view this content.
    Whilst recording it all works as expected but then when i go to run the macro it highlights the term "SolverOk" and gives me a compile error saying "Sub or Function not defined"

    Could anyone help me out with what might be wrong

    Thanks

    EDIT:

    Ok, the solver addin is installed (obviously) but there was no refernce to it in the VBA so the solver libray wasnt loaded.

    So i have gone to Tools -> References and have then found the SOLVER32.DLL and tried to open it but i get an error message saying;

    "Can't add a reference to the specified file"

    Any ideas?
    Last edited by Cookstein2; 11-03-2011 at 08:18 AM. Reason: Stage 2

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: VBA and solver addin Compile Error

    When you go to the list of references don't you just have SOLVER in the list?

  3. #3
    Registered User
    Join Date
    09-22-2009
    Location
    Cornwall, England
    MS-Off Ver
    Excel 2010 (Work) O365Home (Home)
    Posts
    94

    Re: VBA and solver addin Compile Error

    ah yes, and that works fine. Thanks

    Any ideas why it didnt work when browsing through to its home folder?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA and solver addin Compile Error

    The reference needs to be set to the .xla file, not the dll.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    09-22-2009
    Location
    Cornwall, England
    MS-Off Ver
    Excel 2010 (Work) O365Home (Home)
    Posts
    94

    Re: VBA and solver addin Compile Error

    ah ok. When i hit browse it was automatically filtering for .dll files

+ 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