こんにちは、
私はいくつかの出力を生成し、ユーザーの選択に基づいてパワーポイント(またはそうではない)を保存するためのスクリプトを作成しようとしています。 「リストの保存」コマンドがHリストボックス構造内にネストされていると機能しません。
最初のスクリプトはうまくいきます。
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=""></CLOSE>「リストの保存」コマンドをHリストボックス内に移動すると、「プレゼンテーションファイルの書き込みエラー」というエラーが表示されます。ReadWriteモードで開くことができません。システムは、指定されたファイルを見つけることができません"。 下記の動作しないコードを参照してください。
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=""></CLOSE>基本的には、プレゼンテーションを保存するか、単に終了するかをユーザーに選択させます。 ご協力ありがとうございます
これを行う1つの方法は次のとおりです。
Names Default To Here( 1 );
dt1 = Open( path = Pick File( "Select the the DATA TABLE to open." ) );
pathToFolder = Left( path, Contains( path, Word( -1, path, "\/" ) ) - 1 );
返信いただきありがとうございます。 最初のコードセット(保存用のプレゼンテーションがHリストボックスの外側にある)がうまく動作するのは不思議です。
上のコードでは、ファイルは最後のアクティブディレクトリに保存されます。(スクリプトが実行される場所、および入力データファイルがある場所)。 Hリストボックス版のコードでこれを行うにはどうすればよいですか。
問題は、プレゼンテーションの保存に渡しているパス/ファイル名が存在しない、または書き込み権限がないフォルダーを指していることです。 私はあなたのコードを実行しているときに同じメッセージを受け取り、それから私はproduct_nameの値、書き込み可能なディレクトリへのパスに追加し、それからコードはうまくいきました。