SIMULATE>SETVAL
Posted: Wed Jun 15, 2005 5:40 pm
Hi,
I'm just trying to use the SETVAL function in Excel, but I can't find the way to set the value to a variable with subscripts.
I'm using the SETVAL like in this example:
For x = 1 To 40
ro = x + 3
num$ = Worksheets("Sheet1").Cells(ro, 40).Value
con$ = x
comstr$ = "SIMULATE>SETVAL|vd[l" + con$ + "] = " + num$
result = vensim_command(comstr$)
If result = 0 Then Exit Sub
Next
Name of the subscripts: l1,l2,l3,l4,l5...
Name of the variable: vd.
I read in the manual that you need to surround the command in double quotes " ", but I don't understand.
thank's
I'm just trying to use the SETVAL function in Excel, but I can't find the way to set the value to a variable with subscripts.
I'm using the SETVAL like in this example:
For x = 1 To 40
ro = x + 3
num$ = Worksheets("Sheet1").Cells(ro, 40).Value
con$ = x
comstr$ = "SIMULATE>SETVAL|vd[l" + con$ + "] = " + num$
result = vensim_command(comstr$)
If result = 0 Then Exit Sub
Next
Name of the subscripts: l1,l2,l3,l4,l5...
Name of the variable: vd.
I read in the manual that you need to surround the command in double quotes " ", but I don't understand.
thank's