Hi,
I'm trying to create a script to generate some output and the save a powerpoint (or not) based on user selection. I can't get the "save presentation" command to work when it is nested within the H List Box structure.
The first script works fine:
Names Default To Here( 1 );
dt1 = open(Pick File("Select the the DATA TABLE to open.")); //open a file
WinHandle2 = new Window("Graphs",Distribution(Column(2))); //generate some output of interest
product_name = dt1:Product[1]; //get the product name from the first cell in the data table
//OUTPUT report to a Powerpoint file (THIS WORKS FINE):
saveFilename=product_name ||"_Distribution_"||char(year(today())) ||"-"||char(month(today()))||".pptx";
WinHandle2 << Save Presentation(saveFilename, Outline Titles("TopLeft")); //save the output to a Powerpoint file.
//prompt user to see if they want to save and close remaining windows.
w1 = New Window("What's Next?", text box("
Save the report and Close the Data Table?
"),
// Get user input,
H List Box(Button Box("Yes",
WinHandle2<<Close Window(nosave); //close the window
dt1<<Close Window(nosave); //close the data table
w1 <<Close Window; //close this dialog box
),
b = Button Box( "Exit", b << Close Window;
)));If I move the "Save Presentation" command inside the H List Box, I get an error "Error writing presentation file. Unable to open in ReadWrite mode. The system cannot find the file specified". See the non-working code below:
Names Default To Here( 1 );
dt1 = open(Pick File("Select the the DATA TABLE to open.")); //open a file
WinHandle2 = new Window("Graphs",Distribution(Column(2))); //generate some output of interest
product_name = dt1:Product[1]; //get the product name from the first cell in the data table
//prompt user to see if they want to save and close remaining windows.
w1 = New Window("What's Next?", text box("
Save the report and Close the Data Table?
"),
// Get user input,
H List Box(Button Box("Yes",
//OUTPUT report to a Powerpoint file (THIS WORKS FINE):
saveFilename=product_name ||"_Distribution_"||char(year(today())) ||"-"||char(month(today()))||".pptx";
WinHandle2 << Save Presentation(saveFilename, Outline Titles("TopLeft")); //save the output to a Powerpoint file.
WinHandle2<<Close Window(nosave); //close the window
dt1<<Close Window(nosave); //close the data table
w1 <<Close Window; //close this dialog box
),
b = Button Box( "Exit", b << Close Window;
))
);Basically, I want the user to choose if the presentation should be saved, or just exit. Thanks in advance for your help