質問編集履歴

1

【追記1】の部分を追加しました。

2020/05/14 09:07

投稿

znda13
znda13

スコア0

test CHANGED
File without changes
test CHANGED
@@ -18,11 +18,27 @@
18
18
 
19
19
 
20
20
 
21
- ```
21
+ 【追記1】下記試したことの【追記1】実行時のエラー
22
22
 
23
- エラーメッセージ
23
+ Traceback (most recent call last):
24
24
 
25
+ File "<string>", line 1, in <module>
26
+
27
+ File "c:\users\■■■■■■■\py2xl.py", line 15, in myPDF2TXT
28
+
29
+ run(["py", str(py_path), "-o test4.txt", str(ppath)],shell = True,stdout=PIPE,stderr = PIPE,check=True).stdout
30
+
31
+ File "C:\Py\Python\lib\subprocess.py", line 512, in run
32
+
25
- ```
33
+ raise CalledProcessError(retcode, process.args,
34
+
35
+ subprocess.CalledProcessError: Command '['py', 'C:\Py\Python\Scripts\pdf2txt.py', '-o test4.txt', 'None']' returned non-zero exit status 1.
36
+
37
+
38
+
39
+
40
+
41
+
26
42
 
27
43
 
28
44
 
@@ -92,7 +108,13 @@
92
108
 
93
109
  ### 試したこと
94
110
 
95
- シェルコマンドをrunでなくcall、check_out、Popenとする
111
+ シェルコマンドをrunでなくcall、check_out、Popenとする
112
+
113
+ ・【追記1】引数のrowを空白セルになるようにして実行すると上記エラーメッセージの【追記1】が発生します。このことからpython側のrunの実行まではできていて、出力としてテキストファイルを生成するところで不具合があるのではと考えています。
114
+
115
+
116
+
117
+
96
118
 
97
119
 
98
120
 
@@ -103,3 +125,5 @@
103
125
  ・Microsoft Visual Basic for Applications 7.1
104
126
 
105
127
  ・上記xlsmファイルとpyファイル、PDFファイルは同じフォルダに格納してあります
128
+
129
+ ・VBAにはxlwings.basをインポート済です