質問編集履歴
2
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
-----------現在のコード----------------
|
20
20
|
|
21
|
-
|
21
|
+
```ここに言語を入力
|
22
22
|
|
23
23
|
#If VBA7 Then
|
24
24
|
|
@@ -113,3 +113,5 @@
|
|
113
113
|
|
114
114
|
|
115
115
|
End Sub
|
116
|
+
|
117
|
+
```
|
1
コードの追記を行いました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,3 +7,109 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
よろしくお願いいたします。
|
10
|
+
|
11
|
+
sendkeyで開いてしまうと、numlock等がオフになるので、極力使いたくないです。
|
12
|
+
|
13
|
+
(理由が分からないのですが、個人マクロブックも再度開いてしまう)
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
-----------現在のコード----------------
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
#If VBA7 Then
|
24
|
+
|
25
|
+
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal ms As LongPtr)
|
26
|
+
|
27
|
+
#Else
|
28
|
+
|
29
|
+
Private Declare Sub Sleep Lib "kernel32" (ByVal ms As Long)
|
30
|
+
|
31
|
+
#End If
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
sub ie()
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
Dim objIE As InternetExplorer
|
40
|
+
|
41
|
+
Dim objInpTxt As HTMLInputTextElement
|
42
|
+
|
43
|
+
Dim objTag As Object
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
Set objIE = New InternetExplorerMedium
|
48
|
+
|
49
|
+
objIE.Visible = True
|
50
|
+
|
51
|
+
objIE.navigate "http://(社内イントラの為、略)"
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
Do While objIE.Busy = True Or objIE.readyState <> 4
|
56
|
+
|
57
|
+
DoEvents
|
58
|
+
|
59
|
+
Loop
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
Set objInpTxt = objIE.document.getElementsByName("inp_param")(0)
|
64
|
+
|
65
|
+
objInpTxt.Value = "(社内品番の為、略)"
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
For Each objTag In objIE.document.getElementsByTagName("input")
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
If InStr(objTag.outerHTML, "データ抽出") > 0 Then
|
74
|
+
|
75
|
+
objTag.Click
|
76
|
+
|
77
|
+
Do While objIE.Busy = True Or objIE.readyState <> 4
|
78
|
+
|
79
|
+
DoEvents
|
80
|
+
|
81
|
+
Loop
|
82
|
+
|
83
|
+
Exit For
|
84
|
+
|
85
|
+
End If
|
86
|
+
|
87
|
+
Next
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
For Each objTag In objIE.document.getElementsByTagName("input")
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
If InStr(objTag.outerHTML, "ダウンロードCSV") > 0 Then
|
96
|
+
|
97
|
+
objTag.Click
|
98
|
+
|
99
|
+
Exit For
|
100
|
+
|
101
|
+
End If
|
102
|
+
|
103
|
+
Next
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
Sleep 3000
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
SendKeys "%O", True
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
End Sub
|