Script to ask for User input when using "Create Excel Workbook"Hi,
When using "Create Excel Workbook" to export a table to Excel, is there a way to ask the User (possibly via a pop-up window) to input the name that should be used for the Excel tab?
Create Excel Workbook ("c:/results.xlsx",{dtFINAL},{"ASK FOR USER INPUT"});
Thank you!
ScriptingRe: Script to ask for User input when using "Create Excel Workbook"Here is a very simple example. It contains minimal formatting, no exception coding etc. You need to read the Scripting Guide. You may find it more convenient to develop your code using Dashboard Builder or Application Builder. But most importantly, you need to spend the time reading about JSL, so you can learn to solve the simple problems like this one
Names Default To Here( 1 );
nw = New Window( "Enter",
<<MODAL></MODAL>
Re: Script to ask for User input when using "Create Excel Workbook"Hi Txnelson - thank you for your help!
The text box pop-up works for me, but it will not save the user inputed name to an Excel tab (and the Excel tab is not even created). I believe I need to incorporate "dtFINAL" in the "Create Excel Worksheet" script somehow as that is the table I want to save in an Excel tab. This is my full script:
Set Default Directory ( "c:/");
dt = Open ("616641_US JTBD Final.jmp");
md = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Subject ID ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response Indicator ),
Profile Effects( :"Profile ID (Milkshake)"n ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
md << Save Utility Formula;
md << close window;
tb = dt << Tabulate(
Add Table(
Column Table( Analysis Columns( :Utility Formula ), Statistics( Mean, N ) ),
Row Table( Grouping Columns( :"Profile ID (Milkshake)"n ) )
)
);
tb << Make Into Data Table;
dtFINAL = Current Data Table ();
tb << close window;
//Script from TxNelson
Names Default To Here( 1 );
nw = New Window( "Enter",
<<MODAL></MODAL>