cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Scripts in Mathcad

ptc-2620282
1-Newbie

Scripts in Mathcad

Hi, I would like to open a second sheet in mathcad using a script into a button I searched in help : it presents an "Open" method but I don't understand how it works. Can you help me? Thanks
5 REPLIES 5
RichardJ
19-Tanzanite
(To:ptc-2620282)

See the attached example. Richard

Thanks But in fact, I would like to do more things with this new sheet : In the new sheet opened, I would like to - set a variable named "var" to 1 - Save the new sheet - close the new sheet In Help/Developer's Reference, it is written : objMC.SetValue(Name As String, Value As Variant) What is "objMC"? I suppose it corresponds to the new sheet opened but the opening of the new sheet is not sent to a variable. Can you help me please?
RichardJ
19-Tanzanite
(To:ptc-2620282)

"Yann Rouault" wrote:

But in fact, I would like to do more things with this new sheet : In the new sheet opened, I would like to - set a variable named "var" to 1 - Save the new sheet - close the new sheet

I have a model composed of 6 mathcad sheets in "cascade". I explain : -The first one, contains a form with text areas and list boxes in which the user enters the inputs. -Each sheet gives a result -Each sheet except the first one, makes reference to the previous sheet to recover the results and make other calculations Now, I would like to run my model in automatic with a program (a button in a new sheet in Mathcad for example) which, for each turn a the loop : -send the inputs in place of the user (differents for each turn of loop) -run all the sheets -return the final result (of the last mathcad sheet) and write it in a Excel sheet

anonymous wrote:

Why? When you save the sheet the value assigned to "var" will not be saved.

RichardJ
19-Tanzanite
(To:ptc-2620282)

You would be much better off rewriting the final sheet (i.e. the one that references all the others) to make the final answer a function of the parameters you wish to change, and then just calling the function in a loop. It's possible to do what you suggest, but it's probably going to be more work than rewriting the final sheet. Richard
Top Tags