reference solver.dll by code?
reference solver.dll by code?
(OP)
How can I write a code for adding solver reference ?
I know that I can do it manually by clicking on it in Tools->Reference but I want to it automatically by writing code. Can I?
I know that I can do it manually by clicking on it in Tools->Reference but I want to it automatically by writing code. Can I?





RE: reference solver.dll by code?
Usethe AddFromFile method to load the reference. For example on my WinXP system with Office 2003, the following statement will load SOLVER on the currently active excel project.
Application.VBE.ActiveVBProject.References.AddFromFile("C:\Program Files\Microsoft Office\OFFICE11\Library\SOLVER\SOLVER.XLA")