質問編集履歴
2
開示コードを増やしました
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,15 +48,133 @@
|
|
48
48
|
|
49
49
|
```
|
50
50
|
|
51
|
-
|
51
|
+
#If VBA7 Then
|
52
52
|
|
53
|
+
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal ms As LongPtr)
|
54
|
+
|
55
|
+
#Else
|
56
|
+
|
57
|
+
Private Declare Sub Sleep Lib "kernel32" (ByVal ms As Long)
|
58
|
+
|
59
|
+
#End If
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
'接続先URL
|
64
|
+
|
65
|
+
Public Const url1 As String = "https://XXXXXXXXXXXXXXXXXXXXXXXXX"
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
Sub main()
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
Dim objIE As InternetExplorer
|
76
|
+
|
77
|
+
Dim objInpSel As HTMLSelectElement
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
'IE(InternetExplorer)のオブジェクトを作成する
|
82
|
+
|
83
|
+
Set objIE = CreateObject("InternetExplorer.Application")
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
'IEを表示させurl1のページを表示する
|
88
|
+
|
89
|
+
objIE.Visible = True
|
90
|
+
|
91
|
+
objIE.navigate url1
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
'IEの表示を待つ
|
96
|
+
|
97
|
+
Do While objIE.Busy = True Or objIE.readyState < READYSTATE_COMPLETE
|
98
|
+
|
99
|
+
DoEvents
|
100
|
+
|
101
|
+
Loop
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
'ID入力
|
106
|
+
|
107
|
+
objIE.document.getElementsByName("XXXXXXXXXXXXXXXXXX")(0).Focus
|
108
|
+
|
109
|
+
objIE.document.getElementsByName("XXXXXXXXXXXXXXXXXX")(0).Value = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
'PW入力
|
114
|
+
|
115
|
+
objIE.document.getElementsByName("password")(0).Focus
|
116
|
+
|
117
|
+
objIE.document.getElementsByName("password")(0).Value = "XXXXXXXXXXXXXXXX"
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
'ログインボタンをクリック
|
122
|
+
|
123
|
+
objIE.document.getElementsByName("login")(0).Click
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
Do While objIE.Busy = True Or objIE.readyState < READYSTATE_COMPLETE
|
128
|
+
|
129
|
+
DoEvents
|
130
|
+
|
131
|
+
Loop
|
132
|
+
|
133
|
+
'プルダウンからTeam変更
|
134
|
+
|
135
|
+
objIE.document.querySelector("[name=switch_team] option:nth-child(2)").Click
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
Do While objIE.Busy = True Or objIE.readyState < READYSTATE_COMPLETE
|
140
|
+
|
141
|
+
DoEvents
|
142
|
+
|
143
|
+
Loop
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
'========================================
|
148
|
+
|
149
|
+
'Teamを選択
|
150
|
+
|
53
|
-
Set objInpSel = objIE.document.getElementsByName("swich_team")(0)
|
151
|
+
' Set objInpSel = objIE.document.getElementsByName("switch_team")(0)
|
54
152
|
|
55
153
|
|
56
154
|
|
57
155
|
'セレクトボックスを選択
|
58
156
|
|
59
|
-
objInpSel.selectedIndex = 1
|
157
|
+
' objInpSel.selectedIndex = 1
|
158
|
+
|
159
|
+
' Do While objIE.Busy = True Or objIE.readyState < READYSTATE_COMPLETE
|
160
|
+
|
161
|
+
' DoEvents
|
162
|
+
|
163
|
+
' Loop
|
164
|
+
|
165
|
+
'========================================
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
MsgBox "終了しました"
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
End Sub
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
60
178
|
|
61
179
|
```
|
62
180
|
|
1
説明を足しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
関係上コードすべてを載せることはできませんが、以下のようなコードになっています
|
17
|
+
関係上WEBコードすべてを載せることはできませんが、以下のようなコードになっています
|
18
18
|
|
19
19
|
|
20
20
|
|