Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Using Solver add-in across multiple computers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Defoes Right Boot - 22 Feb 2006 09:34 GMT
I have a macro which makes use of the solver add-in.

I want multiple users on multiple machines (which may have Excel installed
in various paths or drives!) to be able to use this.

I have used the line

AddIns("Solver Add-In").Installed = True

to install the add-in at the start of the macro, and it works fine on my
machine however when I try to use it on any other machine it says :

Compile Error - Cannot find project or library.

How can I work the macro so that it correctly installs Solver on any machine?

Thanks

Phil
Bill Martin - 22 Feb 2006 16:10 GMT
I suspect those other machines have not installed Solver from the CD so
it's nowhere to be found on their hard drives and thus cannot be called up
from software -- it takes wetware to shove the CD in the drive, etc.

Bill

--------------------------

> I have a macro which makes use of the solver add-in.
>
[quoted text clipped - 15 lines]
>
> Phil
Defoes Right Boot - 22 Feb 2006 16:32 GMT
Hi Bill

I have not checked all the machines but on the one I did check I found
Solver on the hard disk, but in a different path to the one it is in on my
machine. Once I had manually installed it on this machine the macro worked
fine, but then I exited Excel and tried again and it came up with the same
error as previously.

Is there some way to automatically find Solver on the HD and install it at
the start of the macro or alternatively on opening the worksheet?

Phil

> I suspect those other machines have not installed Solver from the CD so
> it's nowhere to be found on their hard drives and thus cannot be called up
[quoted text clipped - 23 lines]
> >
> > Phil
Bill Martin - 22 Feb 2006 16:44 GMT
No way that I'm aware of, but there are a lot of more clever people than I
here who may provide you with an answer.  Good luck.

Bill
------------------

> Hi Bill
>
[quoted text clipped - 36 lines]
>>>
>>> Phil
Dana DeLouis - 23 Feb 2006 02:31 GMT
Hi.  Hope this helps.  :>)

Sub SolverInstall()
'// Dana DeLouis
   Dim SolverPath As String
   Dim wb As Workbook

   On Error Resume Next
   ' Solver will have Focus if opened:
   ' So, remember ActiveWorkbook (adjust as needed)...
   Set wb = ActiveWorkbook

   SolverPath = Application.LibraryPath & "\SOLVER\SOLVER.XLA"

   If Not AddIns("Solver Add-In").Installed _
       Then AddIns("Solver Add-In").Installed = True

   wb.VBProject.References.AddFromFile SolverPath

   wb.Activate
End Sub

Signature

HTH.  :>)
Dana DeLouis
Windows XP, Office 2003

> No way that I'm aware of, but there are a lot of more clever people than I
> here who may provide you with an answer.  Good luck.
[quoted text clipped - 50 lines]
>>>>
>>>> Phil
Defoes Right Boot - 23 Feb 2006 09:29 GMT
Hi Dana

This has me confused now! Your macro seems to work fine but having run it
when I try and work solver on another machine it still says it can't find it.

This is even though when stepping through your macro, when hovering over "If
Not AddIns("Solver Add-In").Installed" it clearly says that evaluates to True.

I think I may have to do the solving manually instead as it's not a hugely
complex solver scenario!

Thanks for your help anyway...

Phil

> Hi.  Hope this helps.  :>)
>
[quoted text clipped - 72 lines]
> >>>>
> >>>> Phil
Dana DeLouis - 23 Feb 2006 13:50 GMT
Hi.  If  you put this in the beginning, what do you get?

   If Dir(Application.LibraryPath & "\SOLVER\SOLVER.XLA") = vbNullString
Then
       MsgBox "SOLVER.XLA not in Library Path"
   Else
       MsgBox "SOLVER.XLA appears to be in the correct location"
   End If

Signature

HTH.  :>)
Dana DeLouis
Windows XP, Office 2003

> Hi Dana
>
[quoted text clipped - 96 lines]
>> >>>>
>> >>>> Phil
Dana DeLouis - 24 Feb 2006 16:38 GMT
I'm just curious.  If you unload Solver, and then re-load, will that work?

Sub SolverInstall()
'// Dana DeLouis
   Dim SolverPath As String
   Dim wb As Workbook

   SolverPath = Application.LibraryPath & "\SOLVER\SOLVER.XLA"

   If Dir(SolverPath) = vbNullString Then
       MsgBox "SOLVER.XLA not in Library Path"
       Exit Sub
   End If

   On Error Resume Next
   ' Solver will have Focus if opened:
   ' So, remember ActiveWorkbook (adjust as needed)...
   Set wb = ActiveWorkbook

   AddIns("Solver Add-In").Installed = False
'// We remembered ActiveWorkbook before Solver gets Focus...
   AddIns("Solver Add-In").Installed = True

   wb.VBProject.References.AddFromFile SolverPath
   wb.Activate
End Sub

Signature

HTH.  :>)
Dana DeLouis
Windows XP, Office 2003

<snip>

>
>> Hi Dana
[quoted text clipped - 15 lines]
>>
>> Phil

<snip>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.