[API: VBA] How do I get the output from Mathcad worksheet? Hi All,I would like to obtain a value of a variable from my worksheet. Let say my worksheet has x:=1 and y:=x+1=2. What function can I use to get the y value? I was trying with Worksheet.OutputGetRealValue(&As)("y") but I got an error instead. The following is my code: Sub test01()
Dim WS As Ptc_MathcadPrime_Automation.Worksheet
Dim App As Ptc_MathcadPrime_Automation.Application
Set App = New Ptc_MathcadPrime_Automation.Application
FileName = Application.GetOpenFilename(MultiSelect:=False)
Dim conNum As Integer
i = 22
conNum = Cells(i, 7)
Do While Cells(i, 1).Value <> ""
'' inputs
Set WS = App.Open(FileName)
Call WS.SetRealValue("#", Cells(i, 7), "")
Call WS.SetStringValue("M1", Cells(i, 2))
'Call WS.SetStringValue("M2", Cells(i, 4))
Call WS.SetStringValue("M3", Cells(i, 3))
Call WS.SetStringValue("M4", Cells(i, 1))
Call WS.SetRealValue("D2", 3, "")
Call WS.SetRealValue("D3", 3, "")
Call WS.SetRealValue("D4", 3, "")
Call WS.SetRealValue("D1