Hello all,

I have an Excel document that has a macro in it. This macro uses several
solver functions. It looks like this:

Sub Blahblah()
Dim intCounter As Integer
Dim strArg1, strArg2 As String

'Lambdas <= Limits and >= 0
strArg1 = Range(Cells(3, 2), Cells(3, 1 + Range("C1").Value)).Address
strArg2 = Range(Cells(4, 2), Cells(4, 1 + Range("C1").Value)).Address
SolverAdd CellRef:=strArg1, Relation:=1, FormulaText:=strArg2
SolverAdd CellRef:=strArg1, Relation:=3, FormulaText:="0"

'Lambdas add up to 1
SolverAdd CellRef:="$CX$3", Relation:=2, FormulaText:="1"

'Nonnegativity
SolverAdd CellRef:="$I$1", Relation:=3, FormulaText:="0"

SolverOk SetCell:="$I$1", MaxMinVal:=1, ValueOf:="0", ByChange:=strArg1
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=True
End Sub

The macro runs without any problems when called within Excel. Here is my
problem: When I do the following in CF, the web page just does not do anything,
like it is in an infinite loop or sth.

<cftry>
<!--- If it exists, connect to it --->
<cfobject action="CONNECT" class="Excel.Application" name="objExcel"
type="COM">
<cfcatch>
<!--- The object doesn't exist, so create it --->
<cfobject action="CREATE" class="Excel.Application" name="objExcel"
type="COM">
</cfcatch>
</cftry>

<cfset objBooks = objExcel.Workbooks>
<cfset objBook = objBooks.Open("myfile.xls")>
<cfset objBook.Activate()>
<cfset objSheets = objBook.WorkSheets>
<cfset objSheet = objSheets.Item(Val(1))>
<cfset objSheet.Activate()>

<cftry>
<cfset objExcel.Run("Blahblah")>
<cfcatch type="any">
<cfoutput>#cfcatch.Message#</cfoutput>
</cfcatch>
</cftry>

<cfset objBook.Save()>
<cfset objBook.Close()>
<cfset objExcel.Quit()>



The page proceeeds to the next step when I comment out

SolverOk SetCell:="$I$1", MaxMinVal:=1, ValueOf:="0", ByChange:=strArg1
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=True

but it still does not seem to add the constraints. I tried to convert the
lines into a form like:

temp = SolverAdd(strArg1, 1, strArg2)

but it did not help either.

Ideas anyone?