1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SikuliX 1.1.4 日本語PATH入りエクセルファイルを開く

Posted at

Excelを開く際に日本語PATHが入ったxlsxを指定したい

2019/2月時点の失敗例

当初の目論見
excel_path = r"バージョンによって異なる\EXCEL.EXE"
file_path = r"c:\集計\本日の集計.xlsx"
proc = App(path +" "+ excel_path)
proc.open()
# RPA処理
proc.close()

いけると信じていた。
エラーにはならず、
sikulix.jarがあるフォルダをExplorerで開く
という挙動が行われる。

成功例

打開策_サブプロセスを使う
import subprocess
excel_path = r"バージョンによって異なる\EXCEL.EXE"
file_path = r"c:\集計\本日の集計.xlsx"
proc = subprocess.Popen([excel_path , file_path])
# RPA処理
proc.terminate()

致し方なくサブプロセスを使用することにした。

一応日本語をあきらめればいけることは確認した

補足_英語のみ
excel_path = r"c:program\EXCEL.EXE"
file_path = r"c:\aggregate\today.xlsx"
proc = App(path +" "+ excel_path)
proc.open()
# RPA処理
proc.close()

日本語使えないのはRDP的には負けかなと思うのでサブプロセスで行くことにした。
問題が出たらまた考える

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?