質問するログイン新規登録

回答編集履歴

2

追記

2019/07/07 10:00

投稿

Zuishin
Zuishin

スコア28675

answer CHANGED
@@ -8,4 +8,18 @@
8
8
  $sheet = $book.ActiveSheet
9
9
  $textBox = $sheet.Shapes.Item("TextBox 1")
10
10
  $textBox.TextFrame2.TextRange.Text = "新しいテキスト"
11
+ ```
12
+
13
+ # 追記
14
+
15
+ ActiveX の方です。
16
+
17
+ ```PowerShell
18
+ $path = ファイルのフルパス
19
+ $excel = New-Object -ComObject Excel.Application
20
+ $excel.Visible = $true
21
+ $book = $excel.Workbooks.Open($path)
22
+ $sheet = $book.ActiveSheet
23
+ $textBox = $sheet.Shapes.Item("TextBox1")
24
+ $textBox.OLEFormat.Object.Object.Text = "新しいテキスト"
11
25
  ```

1

修正

2019/07/07 10:00

投稿

Zuishin
Zuishin

スコア28675

answer CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ```PowerShell
4
4
  $path = ファイルのフルパス
5
- $excel = new -com Excel.Application
5
+ $excel = New-Object -ComObject Excel.Application
6
6
  $excel.Visible = $true
7
7
  $book = $excel.Workbooks.Open($path)
8
8
  $sheet = $book.ActiveSheet