表形式のデータテーブルを「Dt1」というDatatable変数に格納後、
そのデータテーブルから1番上の行(ヘッダー除く)のみを抽出し、
別のExcelファイルに抽出した行データを張り付ける方法について
ご教示ください。
-
First create one DataTable with all required columns using Build DataTable activity and say ‘newDT’.
-
To read the first row from DataTable.
DataRow firstRow = Dt1(0) -
And then use Add DataRow activity and pass that firstRow and DataTable as newDT.
-
And then use Write Range activity and pass newDT to write into required excel file.
@mac1 さん
こんにちは。
1 「代入」を使用して、dtCopyData = Dt1.clone
2 「メソッドを呼び出し」、Targetobject = dtCopyData,MethodName =ImportRow,プロパティのパラメータを追加して、Dt1.Rows(0)を指定してください。
3 「範囲に書き込む」で2で作成したのデータテーブルを書き込みます。
以上です、ご参考まで
こんにちは
もっと簡潔に書けそうなので...
-
DataTable型変数NewDtを用意し、Assign(代入)アクティビティで
NewDt={Dt1.Rows(0)}.CopyToDatatable()
-
WriteRange(範囲書き込み)でNewDtを書き込み
早くの回答ありがとうございます!
やりたいことができましたので報告となります。
ありがとうございました!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.