View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Tools References...

Thanks
--
Gary''s Student - gsnu200789


"Dave Peterson" wrote:

From a Rob Bovey post:

The Application.Run approach is the one I would suggest. It doesn't
require a reference to the Solver add-in, but it does require that the
Solver add-in be open in Excel and that the calls to Solver procedure names
be fully qualified, e.g.:

Application.Run "Solver.xla!SolverSolve", False

Because Solver is a demand-loaded add-in, you have to do something a
little strange to make sure it's actually open in the user's instance of
Excel. Run the following two lines of code prior to calling any Solver
procedures:

Application.AddIns("Solver Add-in").Installed = False
Application.AddIns("Solver Add-in").Installed = True

The reason for this is that if the user already has Solver selected under
Tools/Add-ins when they open Excel, Excel will consider the add-in loaded
even though Solver.xla doesn't actually open until you select its menu.
Explicitly unloading it and then reloading it in VBA forces Solver.xla to
open no matter what the user's initial settings were.



Gary''s Student wrote:

I distributed a macro that uses Solver. I supplied instructions to the users
to make sure the Solver checkbox in Tools References... was checked before
trying the macro.

A significant number of people called saying the macro did not work (meaning
they ignored the instructions).

Is there any way for the macro to switch on the reference itself??
--
Gary''s Student - gsnu2007xx


--

Dave Peterson