回答編集履歴

2

修正

2019/01/13 02:43

投稿

KotorinChunChun
KotorinChunChun

スコア73

test CHANGED
@@ -34,8 +34,6 @@
34
34
 
35
35
  Dim strPath As String
36
36
 
37
- Dim cnt As Long
38
-
39
37
 
40
38
 
41
39
  Set Folder = CreateObject("Shell.Application"). _
@@ -56,9 +54,21 @@
56
54
 
57
55
 
58
56
 
57
+
58
+
59
+ Dim cnt As Long
60
+
61
+ Dim WS As Worksheet
62
+
63
+ Set WS = ActiveSheet
64
+
65
+
66
+
67
+ WS.Columns(出力列).NumberFormatLocal = "@"
68
+
59
69
  cnt = 5 + 1
60
70
 
61
- Call re_call(strPath, ActiveSheet, cnt)
71
+ Call re_call(strPath, WS, cnt)
62
72
 
63
73
  Debug.Print "次の出力行:" & cnt
64
74
 
@@ -137,3 +147,9 @@
137
147
  End Sub
138
148
 
139
149
  ```
150
+
151
+
152
+
153
+ 追記:エラー1004が出た原因はtextbuf="=="のようです。
154
+
155
+ `WS.Columns(出力列).NumberFormatLocal = "@"`を追加して書式設定を「文字列」に変えることで対処できます。

1

修正

2019/01/13 02:43

投稿

KotorinChunChun
KotorinChunChun

スコア73

test CHANGED
@@ -100,7 +100,7 @@
100
100
 
101
101
  '※改行コードはCRLF
102
102
 
103
- LogArray = Split(objFile.OpenAsTextStream(ForReading).ReadAll, vbCrLf)
103
+ LogArray = Split(objFile.OpenAsTextStream(1).ReadAll, vbCrLf)
104
104
 
105
105
  If UBound(LogArray) > 0 Then
106
106