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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to get a function run only when the worksheet opened in Mathcad

JefferyGu
1-Visitor

How to get a function run only when the worksheet opened in Mathcad

Hi Friends,

How to get a function run only when the worksheet opened in Mathcad?

This function can be easily solved by VBA Auto_Open macro in Excel,bu I don't know how to get it solved in Mathcad. Is there anyone can help me?

Thanks a lot.

Jeffery

ACCEPTED SOLUTION

Accepted Solutions

Richard has passed a components worksheet many times with a fantastic collection of scripted components, might be worth looking in there.

Good idea, but you wouldn't have found something to do this.

You would now though, because I modified the button that can be used to control execution of code

It's also in the attached file

View solution in original post

10 REPLIES 10

I'm not quite sure what your after, can you post a worksheet?

Richard has passed a components worksheet many times with a fantastic collection of scripted components, might be worth looking in there.

http://communities.ptc.com/docs/DOC-1071#comment-3162

Mike

Richard has passed a components worksheet many times with a fantastic collection of scripted components, might be worth looking in there.

Good idea, but you wouldn't have found something to do this.

You would now though, because I modified the button that can be used to control execution of code

It's also in the attached file

Richard,thank you very much.

Hi Richard,

There is a excel file in the attachment. When you open it, it will popup a message "Are you sure you want to continue?". If you click "Ok" button, you will see a message "Congratulations" in "B2" cell in the "Note" sheet. If you click "Cancel" button, it will close the worksheet. You can see all code in the Auto_Open Macro by pressing "Alt"+"F11". Can you help me to implement the function in MachCad?

Best Regards!

Jeffery

RichardJ
19-Tanzanite
(To:JefferyGu)

That's easy to do. Just drop this textbox in the top of the worksheet.

Hi Richard,

Thanks a lot.

Best Regards!

Jeffery

Hi Richard,

How to revise this problem:

I use a Push Button control to close a worksheet. When I press the button, it works well the worksheet is closed. But when I reopen the worksheet and press the button again, it will popup a error message as following:

error.bmp

You can get the test file from attachment.

Best Regards.

Jeffery

Hello!

I'm having the same problem in Mathcad 15 when closing a document.

RichardJ
19-Tanzanite
(To:JefferyGu)

It's clearly a bug in Mathcad. Strange that it happens with the button, but not with the textbox. I can't see any way to get round it though. Sorry.

Mike, thanks for your quick response.

Announcements

Top Tags