Skip to main content
1-Visitor
January 10, 2012
Question

Method to use the IMathCADWorksheet::SetValue

  • January 10, 2012
  • 1 reply
  • 4077 views

Is there any workaround of using the IMathCADWorksheet::SetValue instead of accessing directly the XML file?

1 reply

1-Visitor
January 10, 2012

Karthik,

The SetValue method does not access the Mathcad XML file. SetValue talks to an executing Mathcad process with a worksheet loaded, whether it is visible or not is developers choice. If you want the SetValue changes saved to the XML file you will need to execute the SaveAs method as well before existing.

John

1-Visitor
January 10, 2012

Thank you John.

But the SetValue method of the Worksheet doesnt change anything in the active worksheet when I tried to execute the method from my C++ application. Is there any other method to the change the value in the mathcad worksheet? If there is any sample application it will be helpful for me.

Karthik

1-Visitor
January 10, 2012

Here is what I suspect is biting you Karthik, everyone makes this mistake at first.

If you have a worksheet which has a variable X and X is set to 3.14159 x:=3.14159,

you can NOT use SetValue to reset MC->SetValue("X",99999).

The API runs first pass, sets X to 99999, then the worksheet executes the x:=3.14159.

It looks like SetValue i sdoing nothing, but it is , just first.

So you need a worksheet where X is left unset ... X:=

Try that Karthik