Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default SOLVER macro

Hi,


I have the macro named SOLVER, when I call this macro with the sub routine
MIX, the Compile error occurred with massage "Expect variable or procedure,
not project"



Both macros are given below,

What can be possible mistake,






Sub SOLVER()
Dim StoppedFeederColor As Long
Dim RunningFeederColor As Long
StoppedFeederColor = RGB(150, 150, 150)
RunningFeederColor = RGB(0, 0, 0)
With ThisWorkbook.Worksheets("5 Comp Mix")
Display_off

.Select
SolverOk SetCell:="$t$37", MaxMinVal:=2, ValueOf:="0",
ByChange:="$k$63:$k$67"
solverSolve UserFinish = False
SolverFinish


End With
ThisWorkbook.Worksheets("MainBackground").Select
Display_on


With ThisWorkbook.DialogSheets("MainDlg")
For i = 1 To 5
For j = 1 To 5
If ThisWorkbook.Worksheets("5 Comp Mix").Range("TonsFeed") _
.Cells(i).Value < AlmostZero
Then
.TextBoxes((i - 1) * 5 + j).Font.Color =
StoppedFeederColor
Else
.TextBoxes((i - 1) * 5 + j).Font.Color =
RunningFeederColor
End If
Next j
Next i
End With

End Sub









  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default SOLVER macro

It may not solve (pun intended : ) your problem, but try using a different
name than "Solver" for your macro / subroutine. Excel comes with a Solver
add-in and there might be some confusion caused by that.

Again, not a high possibility, but an easy, quick thing to check.

James


"emilija" wrote in message
...
Hi,


I have the macro named SOLVER, when I call this macro with the sub routine
MIX, the Compile error occurred with massage "Expect variable or

procedure,
not project"



Both macros are given below,

What can be possible mistake,






Sub SOLVER()
Dim StoppedFeederColor As Long
Dim RunningFeederColor As Long
StoppedFeederColor = RGB(150, 150, 150)
RunningFeederColor = RGB(0, 0, 0)
With ThisWorkbook.Worksheets("5 Comp Mix")
Display_off

.Select
SolverOk SetCell:="$t$37", MaxMinVal:=2, ValueOf:="0",
ByChange:="$k$63:$k$67"
solverSolve UserFinish = False
SolverFinish


End With
ThisWorkbook.Worksheets("MainBackground").Select
Display_on


With ThisWorkbook.DialogSheets("MainDlg")
For i = 1 To 5
For j = 1 To 5
If ThisWorkbook.Worksheets("5 Comp Mix").Range("TonsFeed")

_
.Cells(i).Value < AlmostZero
Then
.TextBoxes((i - 1) * 5 + j).Font.Color =
StoppedFeederColor
Else
.TextBoxes((i - 1) * 5 + j).Font.Color =
RunningFeederColor
End If
Next j
Next i
End With

End Sub











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 Macro [email protected] Excel Discussion (Misc queries) 2 August 24th 07 08:54 PM
Is it possible to run Solver using a macro? EA405 Excel Worksheet Functions 1 May 2nd 06 08:05 PM
Macro for Solver Velero Excel Programming 2 February 19th 04 01:39 PM
Solver Macro Dick Stumbo Excel Programming 0 September 18th 03 01:55 AM


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

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

About Us

"It's about Microsoft Excel"