Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #21   Report Post  
Old December 16th 19, 09:34 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 38
Default Problem loading Solver


"programmernovice" wrote in message
Thanks Peter & Garry. I tried following all instructions, even removing
and re-adding Excel in Programs & Features (Windows 10) Now can't run the
following script:

solverok setcell:=Range("Collect.xlsm!absDif"), maxminval:=2,
valueof:="0", bychange:=Range("Collect.xlsm!absDif").Offset(0, -1)
solverSolve (True)
solverfinish (True)

I get:

Compile error:
Can't find project or library

Any ideas? Thanks for your patience, fellows!


I failed to mention that the script shown was obtained by recording the
procedure under the Record macro option of Excel 2007.


As Claus said you need to add a reference to the solver addin, though in an
English system if would be in Tools / References, not "Extras"

If solver.xlam is already loaded tick "SOLVER" which you should see near the
top of the list. But just for this it doesn't need to be loaded or installed
as an addin, just browse to the file in References. In future it should load
automatically with your file if not already loaded.

Peter T



  #22   Report Post  
Old December 16th 19, 11:24 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2018
Posts: 29
Default Problem loading Solver

On Monday, December 16, 2019 at 2:34:27 PM UTC-6, Peter T wrote:
"programmernovice" wrote in message
Thanks Peter & Garry. I tried following all instructions, even removing
and re-adding Excel in Programs & Features (Windows 10) Now can't run the
following script:

solverok setcell:=Range("Collect.xlsm!absDif"), maxminval:=2,
valueof:="0", bychange:=Range("Collect.xlsm!absDif").Offset(0, -1)
solverSolve (True)
solverfinish (True)

I get:

Compile error:
Can't find project or library

Any ideas? Thanks for your patience, fellows!


I failed to mention that the script shown was obtained by recording the
procedure under the Record macro option of Excel 2007.


As Claus said you need to add a reference to the solver addin, though in an
English system if would be in Tools / References, not "Extras"

If solver.xlam is already loaded tick "SOLVER" which you should see near the
top of the list. But just for this it doesn't need to be loaded or installed
as an addin, just browse to the file in References. In future it should load
automatically with your file if not already loaded.

Peter T


Many thanks to Peter, Garry, and now Claus. I resolved all my problems. One last question (I hope). The final pop-up from Solver (Solver Results) requires user to click on the OK button to close it. Is there some way via VBA to do this and completely automate the process.

You guys are incredible resources for a tyro like myself. Thanks for helping me out.
  #23   Report Post  
Old December 17th 19, 03:01 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 38
Default Problem loading Solver

"programmernovice" wrote in message

The final pop-up from Solver (Solver Results) requires user to click on the
OK button to close it. Is there some way via VBA to do this and completely
automate the process.

===============================

It's a while since I've used it, I vaguely recall there is a way though it
seems to have a mind of it's own whether the final dialog appears, or maybe
it's the overall scenario. See if you can find something in the following:

https://www.solver.com/excel-solver-vba-functions
https://peltiertech.com/Excel/SolverVBA.html

Peter T



  #24   Report Post  
Old December 17th 19, 05:04 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2018
Posts: 29
Default Problem loading Solver

On Tuesday, December 17, 2019 at 8:00:38 AM UTC-6, Peter T wrote:
"programmernovice" wrote in message

The final pop-up from Solver (Solver Results) requires user to click on the
OK button to close it. Is there some way via VBA to do this and completely
automate the process.

===============================

It's a while since I've used it, I vaguely recall there is a way though it
seems to have a mind of it's own whether the final dialog appears, or maybe
it's the overall scenario. See if you can find something in the following:

https://www.solver.com/excel-solver-vba-functions
https://peltiertech.com/Excel/SolverVBA.html

Peter T


Thanks Peter. In case it's helpful to you:

SolverSolve True

works. Regards
  #25   Report Post  
Old December 17th 19, 05:12 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 38
Default Problem loading Solver

"programmernovice" wrote in message
On Tuesday, December 17, 2019 at 8:00:38 AM UTC-6, Peter T wrote:
"programmernovice" wrote in message

The final pop-up from Solver (Solver Results) requires user to click on
the
OK button to close it. Is there some way via VBA to do this and
completely
automate the process.

===============================

It's a while since I've used it, I vaguely recall there is a way though
it
seems to have a mind of it's own whether the final dialog appears, or
maybe
it's the overall scenario. See if you can find something in the
following:

https://www.solver.com/excel-solver-vba-functions
https://peltiertech.com/Excel/SolverVBA.html

Peter T


Thanks Peter. In case it's helpful to you:

SolverSolve True

works. Regards


Indeed that's what the documentation says, but don't be surprised if the
dialog appears again!

Peter T




  #26   Report Post  
Old December 17th 19, 05:14 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 38
Default Problem loading Solver


"Peter T" wrote in message
...
"programmernovice" wrote in message
On Tuesday, December 17, 2019 at 8:00:38 AM UTC-6, Peter T wrote:
"programmernovice" wrote in message

The final pop-up from Solver (Solver Results) requires user to click on
the
OK button to close it. Is there some way via VBA to do this and
completely
automate the process.

===============================

It's a while since I've used it, I vaguely recall there is a way though
it
seems to have a mind of it's own whether the final dialog appears, or
maybe
it's the overall scenario. See if you can find something in the
following:

https://www.solver.com/excel-solver-vba-functions
https://peltiertech.com/Excel/SolverVBA.html

Peter T


Thanks Peter. In case it's helpful to you:

SolverSolve True

works. Regards


Indeed that's what the documentation says, but don't be surprised if the
dialog appears again!

Peter T


... and looking back at your post with your code you already had exactly
that...?

PT


  #27   Report Post  
Old December 17th 19, 06:43 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2018
Posts: 29
Default Problem loading Solver

On Tuesday, December 17, 2019 at 10:14:56 AM UTC-6, Peter T wrote:
"Peter T" wrote in message
...
"programmernovice" wrote in message
On Tuesday, December 17, 2019 at 8:00:38 AM UTC-6, Peter T wrote:
"programmernovice" wrote in message

The final pop-up from Solver (Solver Results) requires user to click on
the
OK button to close it. Is there some way via VBA to do this and
completely
automate the process.

===============================

It's a while since I've used it, I vaguely recall there is a way though
it
seems to have a mind of it's own whether the final dialog appears, or
maybe
it's the overall scenario. See if you can find something in the
following:

https://www.solver.com/excel-solver-vba-functions
https://peltiertech.com/Excel/SolverVBA.html

Peter T

Thanks Peter. In case it's helpful to you:

SolverSolve True

works. Regards


Indeed that's what the documentation says, but don't be surprised if the
dialog appears again!

Peter T


.. and looking back at your post with your code you already had exactly
that...?

PT


Well, for now it works. My code had just

SolverSolve

Addition of "True" appears to have helped. Hopefully it will remain so. Thanks, regards
  #28   Report Post  
Old December 17th 19, 07:52 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 38
Default Problem loading Solver

"programmernovice" wrote in message
Peter T

Thanks Peter. In case it's helpful to you:

SolverSolve True

works. Regards

Indeed that's what the documentation says, but don't be surprised if
the
dialog appears again!

Peter T


.. and looking back at your post with your code you already had exactly
that...?

PT


Well, for now it works. My code had just

SolverSolve

Addition of "True" appears to have helped. Hopefully it will remain so.
Thanks, regards


Fair enough and my memory may well be wrong on this.

FWIW in what you said yesterday was your code (when you said it was giving a
compile error) SolverSolve included True:

solverSolve (True)

Peter T



  #29   Report Post  
Old December 17th 19, 10:06 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2018
Posts: 29
Default Problem loading Solver

On Tuesday, December 17, 2019 at 12:52:13 PM UTC-6, Peter T wrote:
"programmernovice" wrote in message
Peter T

Thanks Peter. In case it's helpful to you:

SolverSolve True

works. Regards

Indeed that's what the documentation says, but don't be surprised if
the
dialog appears again!

Peter T

.. and looking back at your post with your code you already had exactly
that...?

PT


Well, for now it works. My code had just

SolverSolve

Addition of "True" appears to have helped. Hopefully it will remain so.
Thanks, regards


Fair enough and my memory may well be wrong on this.

FWIW in what you said yesterday was your code (when you said it was giving a
compile error) SolverSolve included True:

solverSolve (True)

Peter T


I wonder if adding True without parentheses helped? At any rate it appears to work for now. Thanks again for your interest.
  #30   Report Post  
Old December 18th 19, 07:17 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,138
Default Problem loading Solver

On Tuesday, December 17, 2019 at 12:52:13 PM UTC-6, Peter T wrote:
"programmernovice" wrote in message
Peter T

Thanks Peter. In case it's helpful to you:

SolverSolve True

works. Regards

Indeed that's what the documentation says, but don't be surprised if
the
dialog appears again!

Peter T

.. and looking back at your post with your code you already had exactly
that...?

PT

Well, for now it works. My code had just

SolverSolve

Addition of "True" appears to have helped. Hopefully it will remain so.
Thanks, regards


Fair enough and my memory may well be wrong on this.

FWIW in what you said yesterday was your code (when you said it was giving a
compile error) SolverSolve included True:

solverSolve (True)

Peter T


I wonder if adding True without parentheses helped? At any rate it appears
to work for now. Thanks again for your interest.


Normally, the parenthesis are not needed when the method is not on the right
hand side of '=', OR when the enclosed does not include an operator.

SolverSolve True 'correct syntax
SolverSolve (True) 'incorrect syntax

With operator involved:
ret = SolverSolve(True) 'correct syntax if SolverSolve returns a value
bSuccess = (Err = 0) 'correct syntax using an operator
returns True if no error, otherwise returns False

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Solver model loading problem marineCORVETTEran Excel Discussion (Misc queries) 0 July 17th 08 11:31 PM
Referencing and loading Solver programatically - how? CodeMonkey Excel Programming 11 May 4th 06 05:27 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 11:52 PM
Add-in loading problem richardreye Excel Programming 0 September 6th 04 03:31 AM
File Loading Problem Jason Hancock Excel Programming 1 June 20th 04 08:53 PM


All times are GMT +1. The time now is 09:02 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017