Skip to main content
1-Visitor
April 12, 2012
Solved

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

  • April 12, 2012
  • 1 reply
  • 2587 views

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

Best answer by StuartBruff

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

1 reply

23-Emerald V
April 12, 2012

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

JefferyGu1-VisitorAuthor
1-Visitor
April 16, 2012

Hi Stuart,

Thanks very much.

Regards.

Jeffery

23-Emerald V
April 16, 2012

Jeffery Gu wrote:

Hi Stuart,

Thanks very much.

Regards.

Jeffery

No worries, Jeffery.