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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

List Box script

ptc-3058778
1-Newbie

List Box script

How do I modify the list box script to enable the user selected value to be saved when the worksheet is closed. The purpose is to have the selected value displayed the next time the worksheet is opened?
7 REPLIES 7

"Mark Carroll" wrote:

How do I modify the list box script to enable the user selected value to be saved when the worksheet is closed. The purpose is to have the selected value displayed the next time the worksheet is opened?

RichardJ
19-Tanzanite
(To:StuartBruff)

"Stuart Bruff" wrote:

This topic has been addressed on the Mathcad Collaboratory - http://collab.mathsoft.com/ - can't remember where though. However, you're likely to get an answer more rapidly there than you are on this forum. Stuart

I have been fighting with the scripting for this myself. The short answer is that you need to set up worksheet metadata to retain the state of these controls. If you are like me and you have no knowledge of VBScript, then you will need to cut/paste/hack from a sample file like this: download.ptc.com/products/mathcad/files/.../custom-controls13.xmcdz (Or search for "Persistence Mathcad file" and it should turn up.) If anyone reading this knows a good reference for VBScript usage in Mathcad, would you please let me know?

"Robert Wheeler" wrote:

I have been fighting with the scripting for this myself. The short answer is that you need to set up worksheet metadata to retain the state of these controls.

Richard, Thanks. I just took a look at the thread. Fortunately I don't have the problem with the file getting too cumbersome or with the additional Mathcad.exe process. Other than first having to figure out (copy/paste) the metadata script, my real problem was trying to program two sequential list boxes. The first asked the user to pick a class of material, then the second listbox allowed selection of a specific material. The list in the second listbox was dependent on the choice in the first listbox. I hacked around with it for awhile but could never get it quite right - I couldn't get around the conflict between having the second listbox update based on the first listbox choice (i.e., be 'live'), and the need to retain the state of the box using the metadata. I will remember to check the collaboratory in the future.

"Robert Wheeler" wrote:

Richard, Other than first having to figure out (copy/paste) the metadata script, my real problem was trying to program two sequential list boxes. The first asked the user to pick a class of material, then the second listbox allowed selection of a specific material. The list in the second listbox was dependent on the choice in the first listbox. I hacked around with it for awhile but could never get it quite right - I couldn't get around the conflict between having the second listbox update based on the first listbox choice (i.e., be 'live'), and the need to retain the state of the box using the metadata.

"Robert Wheeler" wrote:

Richard, Other than first having to figure out (copy/paste) the metadata script, my real problem was trying to program two sequential list boxes. The first asked the user to pick a class of material, then the second listbox allowed selection of a specific material. The list in the second listbox was dependent on the choice in the first listbox. I hacked around with it for awhile but could never get it quite right - I couldn't get around the conflict between having the second listbox update based on the first listbox choice (i.e., be 'live'), and the need to retain the state of the box using the metadata.

Top Tags