PC Review


Reply
Thread Tools Rate Thread

Can I automate the checking of the "Solver" box in VBA References?

 
 
=?Utf-8?B?cm9iczMxMzE=?=
Guest
Posts: n/a
 
      5th Oct 2007
Hi,

Is there a way to have code check the "Solver" box VBA? FYI - I currently
need to do this manually using the following steps:

- Go to "Tools - Macros - Visual Basic Editor"
- Go to "Tools - References"
- Check the checkbox next to 'Solver' and click 'OK'

Thanks!


--
Robert
 
Reply With Quote
 
 
 
 
Bill Renaud
Guest
Posts: n/a
 
      6th Oct 2007
If you are writing VBA code to use Solver, simply set a reference to it
once in your project (manually, like you are doing now) and you are done.

If you mean that you need to check to see if Solver is installed on another
user's machine before you attempt to make calls to the Solver routines,
then include this line of code somewhere at the top of your code:

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

--
Regards,
Bill Renaud


"robs3131" <(E-Mail Removed)> wrote in message
news:8B048C29-4F3E-4352-BD4E-(E-Mail Removed)...
> Hi,
>
> Is there a way to have code check the "Solver" box VBA? FYI - I

currently
> need to do this manually using the following steps:
>
> - Go to "Tools - Macros - Visual Basic Editor"
> - Go to "Tools - References"
> - Check the checkbox next to 'Solver' and click 'OK'
>
> Thanks!
>
>
> --
> Robert



 
Reply With Quote
 
=?Utf-8?B?cm9iczMxMzE=?=
Guest
Posts: n/a
 
      8th Oct 2007
Thanks Bill. Yeah, I figured out that once you check the box, it remains
checked for that spreadsheet. For some reason I was under the impression
that checking the box was specific to each computer -- similar to installing
Solver on each machine.

Thanks for your feedback.

--
Robert


"Bill Renaud" wrote:

> If you are writing VBA code to use Solver, simply set a reference to it
> once in your project (manually, like you are doing now) and you are done.
>
> If you mean that you need to check to see if Solver is installed on another
> user's machine before you attempt to make calls to the Solver routines,
> then include this line of code somewhere at the top of your code:
>
> AddIns("Solver Add-in").Installed = True
>
> --
> Regards,
> Bill Renaud
>
>
> "robs3131" <(E-Mail Removed)> wrote in message
> news:8B048C29-4F3E-4352-BD4E-(E-Mail Removed)...
> > Hi,
> >
> > Is there a way to have code check the "Solver" box VBA? FYI - I

> currently
> > need to do this manually using the following steps:
> >
> > - Go to "Tools - Macros - Visual Basic Editor"
> > - Go to "Tools - References"
> > - Check the checkbox next to 'Solver' and click 'OK'
> >
> > Thanks!
> >
> >
> > --
> > Robert

>
>
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      8th Oct 2007
You may run into problems if the version of Excel, or the Office
installation directory, is different on the computers using the workbook. I
spent weeks trying to get the referencing to work out in this situation,
which was made more difficult by the security of later Office versions.
Finally I resorted to using Application.Run to call Solver, as I describe
here:

http://peltiertech.com/Excel/SolverVBA.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"robs3131" <(E-Mail Removed)> wrote in message
news6C1C070-26DE-4D38-B882-(E-Mail Removed)...
> Thanks Bill. Yeah, I figured out that once you check the box, it remains
> checked for that spreadsheet. For some reason I was under the impression
> that checking the box was specific to each computer -- similar to
> installing
> Solver on each machine.
>
> Thanks for your feedback.
>
> --
> Robert
>
>
> "Bill Renaud" wrote:
>
>> If you are writing VBA code to use Solver, simply set a reference to it
>> once in your project (manually, like you are doing now) and you are done.
>>
>> If you mean that you need to check to see if Solver is installed on
>> another
>> user's machine before you attempt to make calls to the Solver routines,
>> then include this line of code somewhere at the top of your code:
>>
>> AddIns("Solver Add-in").Installed = True
>>
>> --
>> Regards,
>> Bill Renaud
>>
>>
>> "robs3131" <(E-Mail Removed)> wrote in message
>> news:8B048C29-4F3E-4352-BD4E-(E-Mail Removed)...
>> > Hi,
>> >
>> > Is there a way to have code check the "Solver" box VBA? FYI - I

>> currently
>> > need to do this manually using the following steps:
>> >
>> > - Go to "Tools - Macros - Visual Basic Editor"
>> > - Go to "Tools - References"
>> > - Check the checkbox next to 'Solver' and click 'OK'
>> >
>> > Thanks!
>> >
>> >
>> > --
>> > Robert

>>
>>
>>



 
Reply With Quote
 
Bill Renaud
Guest
Posts: n/a
 
      8th Oct 2007
Very interesting! I don't understand how your CheckSolver function gets the
Solver installed correctly the 2nd time after temporarily uninstalling it
(and before running the Auto_open macro). Why wouldn't Solver simply go
back to the same state that it had when you checked
Application.AddIns("Solver Add-In").Installed the 1st time?

--
Regards,
Bill Renaud



 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      10th Oct 2007
Because it doesn't. <g>

It probably seems flip, but this protocol was developed through hours of
frustration.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Bill Renaud" <(E-Mail Removed)> wrote in message
news:L_WdnRpIJJaV1pfanZ2dnUVZ_h-(E-Mail Removed)...
> Very interesting! I don't understand how your CheckSolver function gets
> the
> Solver installed correctly the 2nd time after temporarily uninstalling it
> (and before running the Auto_open macro). Why wouldn't Solver simply go
> back to the same state that it had when you checked
> Application.AddIns("Solver Add-In").Installed the 1st time?
>
> --
> Regards,
> Bill Renaud
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can one disable (or click "yes" through automate VB) when printing in MS Word and getting "The margins of section 1 are set outside the printable area of the page" Joe Microsoft VB .NET 0 14th Jun 2007 10:43 PM
Can References to "Oracle.DataAccess" AND "System.Data.OracleClient" co-exist in one application ? Peter Kanurer Microsoft C# .NET 4 9th Jun 2007 05:09 PM
Shortcut key for "Paste Options" and "Error Checking" buttons? =?Utf-8?B?am9obmRvZw==?= Microsoft Excel Misc 1 6th Oct 2006 11:56 AM
How do I enter cell references in "Equal to" box in solver =?Utf-8?B?amhlbHA=?= Microsoft Excel Worksheet Functions 3 19th Sep 2005 03:57 PM
Re: Confusing Solver results - "Solver Enable#1.xls" 39.9 KBytes Dana DeLouis Microsoft Excel Discussion 1 26th Aug 2004 11:21 AM


Features
 

Advertising
 

Newsgroups
 


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