Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems running Solver from VB: Windows 2000 users?


When I run my code the 'Subject to the constraints' gets filled fine
but for some reson 'Set Target Cell' and 'By Chaning Cells' remai
blank. Any idea what might be causing the problem -- could it be som
bug in Windows 2000? Thanks

~~~~~
Sub Program()

SolverOk SetCell:=Range("A1"), MaxMinVal:=1, ValueOf:="0"
ByChange:=Range("B1:B10") ' this is the stuff that gets omitted

SolverAdd CellRef:=Range("e2"), Relation:=2
FormulaText:=Range("C1")
SolverAdd CellRef:=Range("B1:B10"), Relation:=1
FormulaText:=1
SolverAdd CellRef:=Range("B1:B10"), Relation:=3
FormulaText:=0

SolverSolve Userfinish:=True

End Su

--
karamelm
-----------------------------------------------------------------------
karamelmu's Profile: http://www.excelforum.com/member.php...fo&userid=1557
View this thread: http://www.excelforum.com/showthread.php?threadid=27133

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Problems running Solver from VB: Windows 2000 users?

I am having the same problem - no SetCell and ByChange values. Did you ever
get this resolved?

Thanks

"karamelmu" wrote:


When I run my code the 'Subject to the constraints' gets filled fine,
but for some reson 'Set Target Cell' and 'By Chaning Cells' remain
blank. Any idea what might be causing the problem -- could it be some
bug in Windows 2000? Thanks

~~~~~
Sub Program()

SolverOk SetCell:=Range("A1"), MaxMinVal:=1, ValueOf:="0",
ByChange:=Range("B1:B10") ' this is the stuff that gets omitted

SolverAdd CellRef:=Range("e2"), Relation:=2,
FormulaText:=Range("C1")
SolverAdd CellRef:=Range("B1:B10"), Relation:=1,
FormulaText:=1
SolverAdd CellRef:=Range("B1:B10"), Relation:=3,
FormulaText:=0

SolverSolve Userfinish:=True

End Sub


--
karamelmu
------------------------------------------------------------------------
karamelmu's Profile: http://www.excelforum.com/member.php...o&userid=15573
View this thread: http://www.excelforum.com/showthread...hreadid=271337


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Problems running Solver from VB: Windows 2000 users?

I know that the documentation indicates you can set the SetCell and
ByChange cells to a range. However, if you use the macro recorder to
have XL generate the code, you will find it actually uses the address
of the range.

Don't know if that is relevant to your problem, but you may want to
test it.

SolverOk SetCell:=Range("A1").Address, MaxMinVal:=1, ValueOf:="0", _
ByChange:=Range("B1:B10").Address

For example, I tested another model that was convenient and the
following worked in both versions I tested (2000 and 2003):

Sub testIt()
solverreset
SolverOk SetCell:="$D$1", MaxMinVal:=1, ValueOf:="0", _
ByChange:="$C$1:$C$6"
SolverAdd CellRef:="$C$1:$C$6", Relation:=5, FormulaText:="binary"
SolverAdd CellRef:="$C$7", Relation:=1, FormulaText:="1"
SolverSolve userfinish:=True
End Sub

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I am having the same problem - no SetCell and ByChange values. Did you ever
get this resolved?

Thanks

"karamelmu" wrote:


When I run my code the 'Subject to the constraints' gets filled fine,
but for some reson 'Set Target Cell' and 'By Chaning Cells' remain
blank. Any idea what might be causing the problem -- could it be some
bug in Windows 2000? Thanks

~~~~~
Sub Program()

SolverOk SetCell:=Range("A1"), MaxMinVal:=1, ValueOf:="0",
ByChange:=Range("B1:B10") ' this is the stuff that gets omitted

SolverAdd CellRef:=Range("e2"), Relation:=2,
FormulaText:=Range("C1")
SolverAdd CellRef:=Range("B1:B10"), Relation:=1,
FormulaText:=1
SolverAdd CellRef:=Range("B1:B10"), Relation:=3,
FormulaText:=0

SolverSolve Userfinish:=True

End Sub


--
karamelmu
------------------------------------------------------------------------
karamelmu's Profile:
http://www.excelforum.com/member.php...o&userid=15573
View this thread: http://www.excelforum.com/showthread...hreadid=271337



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Problems running Solver from VB: Windows 2000 users?

I am having the same problem - no SetCell or ByChange values. Did you ever
get this resolved?

Thanks

"karamelmu" wrote:


When I run my code the 'Subject to the constraints' gets filled fine,
but for some reson 'Set Target Cell' and 'By Chaning Cells' remain
blank. Any idea what might be causing the problem -- could it be some
bug in Windows 2000? Thanks

~~~~~
Sub Program()

SolverOk SetCell:=Range("A1"), MaxMinVal:=1, ValueOf:="0",
ByChange:=Range("B1:B10") ' this is the stuff that gets omitted

SolverAdd CellRef:=Range("e2"), Relation:=2,
FormulaText:=Range("C1")
SolverAdd CellRef:=Range("B1:B10"), Relation:=1,
FormulaText:=1
SolverAdd CellRef:=Range("B1:B10"), Relation:=3,
FormulaText:=0

SolverSolve Userfinish:=True

End Sub


--
karamelmu
------------------------------------------------------------------------
karamelmu's Profile: http://www.excelforum.com/member.php...o&userid=15573
View this thread: http://www.excelforum.com/showthread...hreadid=271337


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
Page breaks are different in Windows 2000 and Windows XP Bill Allen Excel Discussion (Misc queries) 1 November 23rd 05 04:42 PM
problems switching speadsheets in excel 2000 using windows xp berger Excel Discussion (Misc queries) 0 October 19th 05 10:39 PM
Excel Programs developed in Office 2000 on Windows 2000 Trooper Excel Discussion (Misc queries) 4 March 12th 05 11:09 PM
Excel 2000 running on Windows XP SP2 does not properly open CSV fi Oscar Excel Discussion (Misc queries) 1 December 20th 04 10:10 PM
Code-signing certificate problems in Excel 2000 with Windows 2000 Aaron Queenan Excel Programming 0 May 6th 04 11:35 AM


All times are GMT +1. The time now is 02:58 AM.

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"