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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Mathcad 15 to Mathcad Prime

GG_11924958
2-Explorer

Mathcad 15 to Mathcad Prime

Hi,
On Mathcad 15 I used a VB script to recalculate the worksheet using a "worksheet.Recalculate()" comment assigned to a button, but this comment not working on the PTC Mathcad Prime API.

Can you help me to solve this.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:GG_11924958)

The method is now called Worksheet. Synchronize()

See attached a Prime 10 sheet with a "recalculate" button.

The Prime help is a nightmare, especially when it comes do the API and the advanced controls. It definitely does not deserve to be called “help” and certainly not “documentation”.
Nevertheless, somewhere in the depths of this “Help” you will find the very button that I use in the attached sheet.
Unfortunately, I couldn't find the place in the confusing help where this button comes from. It is neither in the description of the controls button, nor in its example, nor in the “documentation” of the API.
However, I definitely know that I once copied it from the Prime help ...

Here is the script (JScript) used in the button

 

function PushBtnEvent_Start(Inputs, Outputs) {
};

function PushBtnEvent_Exec(Inputs, Outputs) {
};

function PushBtnEvent_Stop(Inputs, Outputs) {
};

function PushBtn_Click(Inputs, Outputs) {
    var Mathcad = new ActiveXObject("MathcadPrime.Application");
    if (Mathcad != null) {
        var Worksheet = Mathcad.ActiveWorksheet;
        if (Worksheet != null) {
            Worksheet. Synchronize();
            Worksheet = null;
        }
        Mathcad = null;
    }
};

 

 

EDIT: Heureka! Finally found the help page where the button stems from. Shouldn't help be more intuitive to use ....?

-> Worksheet Settings

 

View solution in original post

2 REPLIES 2
Werner_E
25-Diamond I
(To:GG_11924958)

The method is now called Worksheet. Synchronize()

See attached a Prime 10 sheet with a "recalculate" button.

The Prime help is a nightmare, especially when it comes do the API and the advanced controls. It definitely does not deserve to be called “help” and certainly not “documentation”.
Nevertheless, somewhere in the depths of this “Help” you will find the very button that I use in the attached sheet.
Unfortunately, I couldn't find the place in the confusing help where this button comes from. It is neither in the description of the controls button, nor in its example, nor in the “documentation” of the API.
However, I definitely know that I once copied it from the Prime help ...

Here is the script (JScript) used in the button

 

function PushBtnEvent_Start(Inputs, Outputs) {
};

function PushBtnEvent_Exec(Inputs, Outputs) {
};

function PushBtnEvent_Stop(Inputs, Outputs) {
};

function PushBtn_Click(Inputs, Outputs) {
    var Mathcad = new ActiveXObject("MathcadPrime.Application");
    if (Mathcad != null) {
        var Worksheet = Mathcad.ActiveWorksheet;
        if (Worksheet != null) {
            Worksheet. Synchronize();
            Worksheet = null;
        }
        Mathcad = null;
    }
};

 

 

EDIT: Heureka! Finally found the help page where the button stems from. Shouldn't help be more intuitive to use ....?

-> Worksheet Settings

 

Thank you so much.

Announcements

Top Tags