Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Solver VBA control


Hi,

I'm controlling Solver via VBA. But to do this you must add in SOLVE
via the Tools References within VBA. If you don't do this first th
macro crashes. However, as I'm going to give this worksheet to othe
people is there a way to either automatically add SOLVER in within VB
or to check it it's loaded?

Any help would be appreciated.

Thanks

Chri

--
Chris
-----------------------------------------------------------------------
ChrisK's Profile: http://www.excelforum.com/member.php...fo&userid=1637
View this thread: http://www.excelforum.com/showthread.php?threadid=27751

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Solver VBA control



if you want to set the reference with code, here is some code posted by Dana
DeLouise

http://groups.google.com/groups?thre...gp13 .phx.gbl

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

On Error Resume Next
' Set a Reference to the workbook that will hold Solver
Set wb = ActiveWorkbook

With wb.VBProject.References
.Remove .Item("SOLVER")
End With

With AddIns("Solver Add-In")
.Installed = False
.Installed = True
wb.VBProject.References.AddFromFile .FullName
End With
End Sub


This line adds the reference:
wb.VBProject.References.AddFromFile .FullName

The other parts make sure it is loaded as an addin.
-----------------------------------------------------


----------------- an article you might find useful:



http://support.microsoft.com/support...ver/solver.asp
Creating Visual Basic Macros that Use Microsoft Excel Solver

--
Regards,
Tom Ogilvy


"ChrisK" wrote in message
...

Hi,

I'm controlling Solver via VBA. But to do this you must add in SOLVER
via the Tools References within VBA. If you don't do this first the
macro crashes. However, as I'm going to give this worksheet to other
people is there a way to either automatically add SOLVER in within VBA
or to check it it's loaded?

Any help would be appreciated.

Thanks

Chris


--
ChrisK
------------------------------------------------------------------------
ChrisK's Profile:

http://www.excelforum.com/member.php...o&userid=16375
View this thread: http://www.excelforum.com/showthread...hreadid=277517



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
Excel spin box - no Control tab in Format Control dialong box tocoau Excel Worksheet Functions 7 August 10th 08 03:15 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
Resetting Solver Manually to Fix Solver Bug Stratuser Excel Programming 0 September 13th 04 07:04 PM
Calendar Control: Can't exit design mode because control can't be created Rone Excel Programming 0 May 24th 04 04:01 PM


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"