2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Power AppsからExcel帳票へ転記

Last updated at Posted at 2025-05-18

緒言

Power Appsが普及しても数多く残るExcel帳票。Appsで入力したデータを基にPower Automate経由でOffice ScriptsをキックしてExcel帳票へ転記する方法について。

デモ実装

デモExcel帳票

image.png

転記用Office Scripts例。Appsからの引継ぎデータが大量にある場合はJSON形式にする等の工夫必要。

function main(
  workbook: ExcelScript.Workbook,
  textParam1: string,
  textParam2: string
) {
  // アクティブシートを取得
  let activeSheet = workbook.getActiveWorksheet();

  // セル "C3" に textParam1 を挿入
  activeSheet.getRange("C3").setValue(textParam1);

  // セル "C5" に textParam2 を挿入
  activeSheet.getRange("C5").setValue(textParam2);
}

デモアプリ

image.png
ボタンのOnSelectで↓フロー実行

AppsToExcel.Run(TextInput1.Text,TextInput1_1.Text)

デモフロー

スクリプト実行してコンテンツ取得してメール配信する。スクリプト実行の競合が心配だったりする場合は事前コピーなどで対処。
image.png
image.png

結言

スクリプトはAI先生に聞けばほぼ正解作ってくれますね。ありがたや。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?