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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

how to get a program run just only when the worksheet is opened

JefferyGu
1-Newbie

how to get a program run just only when the worksheet is opened

Hi Friends,

Is there anybody knows that how to get a program run just only when the worksheet is opened?

There are some codes in the TextBox control in the test.xmcd file. When I press Ctrl+F9 button, all the code will be executed again. In fact, I just want them to be executed when I open the worksheet, and then do not let them run even when I press the Ctrl+F9 button.

As we know, this function is easy to realized in Excel. Can it be implemented in Mathcad?

Thanks and Best Regards.

Jeffery

1 ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald II
(To:JefferyGu)

Jeffery Gu wrote:

Hi Friends,

Is there anybody knows that how to get a program run just only when the worksheet is opened?

There are some codes in the TextBox control in the test.xmcd file. When I press Ctrl+F9 button, all the code will be executed again. In fact, I just want them to be executed when I open the worksheet, and then do not let them run even when I press the Ctrl+F9 button.

As we know, this function is easy to realized in Excel. Can it be implemented in Mathcad?

Thanks and Best Regards.

Jeffery

Try the attached. It has some code to detect first time of running and then avoids running the 'start' code if it's already happened.

Stuart

View solution in original post

3 REPLIES 3
StuartBruff
23-Emerald II
(To:JefferyGu)

Jeffery Gu wrote:

Hi Friends,

Is there anybody knows that how to get a program run just only when the worksheet is opened?

There are some codes in the TextBox control in the test.xmcd file. When I press Ctrl+F9 button, all the code will be executed again. In fact, I just want them to be executed when I open the worksheet, and then do not let them run even when I press the Ctrl+F9 button.

As we know, this function is easy to realized in Excel. Can it be implemented in Mathcad?

Thanks and Best Regards.

Jeffery

Try the attached. It has some code to detect first time of running and then avoids running the 'start' code if it's already happened.

Stuart

Hi Stuart,

Thanks very much.

Regards.

Jeffery

StuartBruff
23-Emerald II
(To:JefferyGu)

Jeffery Gu wrote:

Hi Stuart,

Thanks very much.

Regards.

Jeffery

No worries, Jeffery.

Top Tags