If OptionButton1.Value = True Then WebBrowser1.Document.forms(0).sijyokbn.Value = "1" ElseIf (OptionButton2.Value = True) Then WebBrowser1.Document.forms(0).sijyokbn.Value = "2" End If WebBrowser1.Document.forms(0).submit Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop
Range("BB10") = Mid(WebBrowser1.Document.Body.InnerText, 13, 10) If Range("BB10") = "想定建玉金額が新規建" Then Label4 = "保証金不足" Else
Range("BB10") = Mid(WebBrowser1.Document.Body.InnerText, 13, 10) If Range("BB10") = "ご指定の価格が値幅制" Then Label4 = "価格入力エラー" Else Label4 = "空売り成功"
Range("BB10") = Mid(WebBrowser1.Document.Body.InnerText, 13, 10) If Range("BB10") = "ご指定の銘柄は存在し" Then Label4 = "銘柄なし" Else Label4 = "空売り成功"
WebBrowser1.Document.all.ok.Click End If End If End If Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop AAA = WebBrowser1.Document.Links(0).href WebBrowser1.Navigate (AAA) Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Range("CM15") = Left(WebBrowser1.Document.URL, 200) YK = InStr(WebBrowser1.Document.Body.InnerText, "状態:") Spreadsheet1.Range("A2") = Mid(WebBrowser1.Document.Body.InnerText, YK + 3, 4)
Spreadsheet1.Range("D1") = Range("CM15") Spreadsheet1.Range("A1") = Range("BB11") Spreadsheet1.Range("B1") = Range("BB13") Spreadsheet1.Range("C1") = Range("BB15") Range("CM24") = Range("BB15") Range("CL24") = Range("BB11") End If End Sub
Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Spreadsheet1.Range("A1") = "" Spreadsheet1.Range("A2") = "" Spreadsheet1.Range("B1") = "" Spreadsheet1.Range("C1") = "" Spreadsheet1.Range("D1") = "" End If End If End Sub
BBB = Spreadsheet1.Range("D1") WebBrowser1.Navigate (BBB) Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop
Range("BC10") = Mid(WebBrowser1.Document.Body.InnerText, 41, 2) If Range("BC10") = "前へ" Then kkk = WebBrowser1.Document.Links(2).href WebBrowser1.Navigate (kkk) Else CCC = WebBrowser1.Document.Links(1).href WebBrowser1.Navigate (CCC) End If Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop WebBrowser1.Document.all.afterNariSasiKbn.Item(1).Checked = True WebBrowser1.Document.forms(0).tseiKingk.Value = Spreadsheet1.Range("C1") WebBrowser1.Document.forms(0).submit
Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop End If Range("CM15") = Left(WebBrowser1.Document.URL, 200) Spreadsheet1.Range("D1") = Range("CM15") End Sub
Private Sub SpinButton1_SpinDown() If LD.価格テキスト.Value < 2000 Then LD.価格テキスト.Value = LD.価格テキスト.Value - 1 End If If LD.価格テキスト.Value < 3000 Then If LD.価格テキスト.Value >= 2000 Then LD.価格テキスト.Value = LD.価格テキスト.Value - 5 End If End If If 3000 <= LD.価格テキスト.Value Then If 99900 > LD.価格テキスト.Value Then LD.価格テキスト.Value = LD.価格テキスト.Value - 10 End If End If
If LD.価格テキスト.Value = "" Then LD.価格テキスト.Value = 0 End If If 100000 <= LD.価格テキスト.Value Then LD.価格テキスト.Value = LD.価格テキスト.Value - 1000 End If
Private Sub SpinButton1_SpinUp() If 2000 > LD.価格テキスト.Value Then LD.価格テキスト.Value = LD.価格テキスト.Value + 1 End If
If LD.価格テキスト.Value < 3000 Then If LD.価格テキスト.Value >= 2000 Then LD.価格テキスト.Value = LD.価格テキスト.Value + 5 End If End If
If 3000 <= LD.価格テキスト.Value Then If 99900 > LD.価格テキスト.Value Then LD.価格テキスト.Value = LD.価格テキスト.Value + 10 End If End If If LD.価格テキスト.Value = "" Then LD.価格テキスト.Value = 0 End If If 100000 < LD.価格テキスト.Value Then LD.価格テキスト.Value = LD.価格テキスト.Value + 1000 End If
Private Sub SpinButton2_SpinUp() If LD.数量テキスト.Value < 100 Then LD.数量テキスト.Value = LD.数量テキスト.Value + 1 End If If LD.数量テキスト.Value < 1000 Then If LD.数量テキスト.Value >= 100 Then LD.数量テキスト.Value = LD.数量テキスト.Value + 100 End If End If If LD.数量テキスト.Value >= 1000 Then LD.数量テキスト.Value = LD.数量テキスト.Value + 1000 End If
End Sub Private Sub SpinButton2_SpinDown()
If LD.数量テキスト.Value < 100 Then LD.数量テキスト.Value = LD.数量テキスト.Value - 1 End If If LD.数量テキスト.Value >= 100 Then If LD.数量テキスト.Value < 1000 Then LD.数量テキスト.Value = LD.数量テキスト.Value - 100 End If End If If LD.数量テキスト.Value >= 1000 Then LD.数量テキスト.Value = LD.数量テキスト.Value - 1000 End If
Private Sub SpinButton2_SpinUp() If LD.数量テキスト.Value < 100 Then LD.数量テキスト.Value = LD.数量テキスト.Value + 1 End If If LD.数量テキスト.Value < 1000 Then If LD.数量テキスト.Value >= 100 Then LD.数量テキスト.Value = LD.数量テキスト.Value + 100 End If End If If LD.数量テキスト.Value >= 1000 Then LD.数量テキスト.Value = LD.数量テキスト.Value + 1000 End If
End Sub Private Sub SpinButton2_SpinDown()
If LD.数量テキスト.Value < 100 Then LD.数量テキスト.Value = LD.数量テキスト.Value - 1 End If If LD.数量テキスト.Value >= 100 Then If LD.数量テキスト.Value < 1000 Then LD.数量テキスト.Value = LD.数量テキスト.Value - 100 End If End If If LD.数量テキスト.Value >= 1000 Then LD.数量テキスト.Value = LD.数量テキスト.Value - 1000 End If
Private Sub Workbook_SheetActivate(ByVal Sh As Object) コードテキスト.ControlSource = Sh.Name & "!CM2" 数量テキスト.ControlSource = Sh.Name & "!CM4" 価格テキスト.ControlSource = Sh.Name & "!CM6" End Sub
Private Sub CommandButton14_Click() WebBrowser1.Navigate "https://trade.kabu.livedoor.com/IMode/00002555/imode/m/m_shinyoukouza.htm" Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop AAA = WebBrowser1.Document.Links(1).href WebBrowser1.Navigate (AAA) Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop
QQQ = InStr(WebBrowser1.Document.Body.InnerText, "特定") Spreadsheet2.Range("A2") = Mid(WebBrowser1.Document.Body.InnerText, QQQ + 2, 1) If Spreadsheet2.Range("A2") = ":" Then
BBB = WebBrowser1.Document.Links(0).href WebBrowser1.Navigate (BBB) Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop TTT = InStr(WebBrowser1.Document.Body.InnerText, "建玉詳細") Spreadsheet2.Range("A1") = Mid(WebBrowser1.Document.Body.InnerText, TTT + 10, 4) Spreadsheet2.Range("B1") = Mid(WebBrowser1.Document.Body.InnerText, TTT + 15, 4)
Private Sub CommandButton15_Click() HHHH = Spreadsheet2.Range("E1") WebBrowser1.Navigate (HHHH) Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop
WebBrowser1.Document.forms(0).suryo.Value = Spreadsheet2.Range("D1") WebBrowser1.Document.forms(0).kakaku.Value = Spreadsheet2.Range("C1") WebBrowser1.Document.all.nariSasiKbn.Item(1).Checked = True WebBrowser1.Document.all.autotukeUrl.Click Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Spreadsheet2.Range("A2") = Mid(WebBrowser1.Document.Body.InnerText, 35, 10) If Spreadsheet2.Range("A2") = "ご指定の市場では数量" Then Spreadsheet2.Range("A2") = "数量エラー" Else If Spreadsheet2.Range("A2") = "ご指定の市場および建" Then Spreadsheet2.Range("A2") = "数量エラー" Else WebBrowser1.Document.all.ok.Click
Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop CCC = WebBrowser1.Document.Links(0).href WebBrowser1.Navigate (CCC) Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop
B = Spreadsheet2.Range("E1") WebBrowser1.Navigate (B)
Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop WebBrowser1.Refresh Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop
time10 = DateAdd("s", 1, Now()) Do While True DoEvents If time10 < Now() Then Exit Do '時刻のチェック Loop
Spreadsheet2.Range("E1") = Left(WebBrowser1.Document.URL, 200) LLL = InStr(WebBrowser1.Document.Body.InnerText, "状態:") Spreadsheet2.Range("A2") = Mid(WebBrowser1.Document.Body.InnerText, LLL + 3, 4) End Sub
BBB = Spreadsheet2.Range("E1") WebBrowser1.Navigate (BBB) Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop
Spreadsheet2.Range("A2") = Mid(WebBrowser1.Document.Body.InnerText, 41, 2) If Spreadsheet2.Range("A2") = "前へ" Then kkk = WebBrowser1.Document.Links(2).href WebBrowser1.Navigate (kkk) Else CCC = WebBrowser1.Document.Links(1).href WebBrowser1.Navigate (CCC) End If Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop WebBrowser1.Document.all.afterNariSasiKbn.Item(1).Checked = True WebBrowser1.Document.forms(0).tseiKingk.Value = Spreadsheet2.Range("C1") WebBrowser1.Document.forms(0).submit Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop
Private Sub CommandButton18_Click() WebBrowser1.Navigate "https://trade.kabu.livedoor.com/IMode/00002555/imode/m/m_shinyoukouza.htm" Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop AAA = WebBrowser1.Document.Links(1).href WebBrowser1.Navigate (AAA)
Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop WebBrowser1.Refresh
time10 = DateAdd("s", 1, Now()) Do While True DoEvents If time10 < Now() Then Exit Do '時刻のチェック Loop
Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop AAA = WebBrowser1.Document.Links(0).href WebBrowser1.Navigate (AAA) Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop ZZZ = Left(WebBrowser1.Document.URL, 200) Spreadsheet2.Range("E1") = Left(WebBrowser1.Document.URL, 200)
Else Spreadsheet2.Range("A1") = "" Spreadsheet2.Range("B1") = "" Spreadsheet2.Range("C1") = "" Spreadsheet2.Range("D1") = "" Spreadsheet2.Range("E1") = "" End If End Sub
Private Sub CommandButton22_Click() WebBrowser1.Navigate "https://trade.kabu.livedoor.com/IMode/00002555/imode/m/m_shinyoukouza.htm" Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop AAA = WebBrowser1.Document.Links(1).href WebBrowser1.Navigate (AAA) Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop WebBrowser1.Refresh time10 = DateAdd("s", 1, Now()) Do While True DoEvents If time10 < Now() Then Exit Do '時刻のチェック Loop If WebBrowser1.Document.Links.Length > 7 Then Spreadsheet2.Range("A1") = "" Spreadsheet2.Range("B1") = "" Spreadsheet2.Range("C1") = "" Spreadsheet2.Range("D1") = "" Spreadsheet2.Range("E1") = ""
BBB = Spreadsheet2.Range("E1") WebBrowser1.Navigate (BBB) Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop
Spreadsheet2.Range("A2") = Mid(WebBrowser1.Document.Body.InnerText, 41, 2) If Spreadsheet2.Range("A2") = "前へ" Then kkk = WebBrowser1.Document.Links(2).href WebBrowser1.Navigate (kkk) Else CCC = WebBrowser1.Document.Links(2).href WebBrowser1.Navigate (CCC) End If Do While WebBrowser1.Document.ReadyState <> "complete" DoEvents Loop Do While WebBrowser1.ReadyState <> 4 '4の完了以外ループ DoEvents Loop
Private Declare Function ShellExecute Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, _ ByVal lpOperation As String, ByVal lpFile As String, _ ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long
IE = GETACTIVEOLEOBJ("InternetExplorer.Application") IE.visible = True IE.navigate("https://trade.kabu.livedoor.com/Login/0/imode/login_h") while True // 接続表示待ち if (! IE.busy) and (IE.readyState=4) then Break sleep(0.1) wend
IE.document.all.koza1.value = "" IE.document.all.koza2.value = "" IE.document.all.passwd.value = "" IE.document.forms[0].elements[3].click() while True // 接続表示待ち if (! IE.busy) and (IE.readyState=4) then Break sleep(0.1) wend LAST_LINK = IE.document.links[1].href IE.navigate(LAST_LINK)
while True // 接続表示待ち if (! IE.busy) and (IE.readyState=4) then Break sleep(0.1) wend LAST_LINK = IE.document.links[2].href IE.navigate(LAST_LINK)
if (! IE.busy) and (IE.readyState=4) then Break sleep(0.1) wend IE.document.forms[0].elements[15].click() while True // 接続表示待ち if (! IE.busy) and (IE.readyState=4) then Break sleep(0.1) wend IE.document.all.ok.click() while True // 接続表示待ち if (! IE.busy) and (IE.readyState=4) then Break sleep(0.1) wend LAST_LINK = IE.document.links[0].href IE.navigate(LAST_LINK)
while True // 接続表示待ち if (! IE.busy) and (IE.readyState=4) then Break sleep(0.1) wend SENDSTR(0, IE.document.URL)
Private Sub Workbook_SheetActivate(ByVal Sh As Object) コードテキスト.ControlSource = Sh.Name & "!CM2" 数量テキスト.ControlSource = Sh.Name & "!CM4" 価格テキスト.ControlSource = Sh.Name & "!CM6" End Sub
Private Declare Function ShellExecute Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, _ ByVal lpOperation As String, ByVal lpFile As String, _ ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Private Sub Worksheet_Change(ByVal Target As Range) If Range("BC15") = "1" Then Dim LngRet As Long LngRet = ShellExecute(0, vbNullString, "****.UWS", _ vbNullString, vbNullString, 1) Else: Range("BC15") = "0" End Sub
Private Sub コードテキスト_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, _ ByVal X As Single, ByVal Y As Single)
If Button = 2 Then On Error Resume Next Application.CommandBars("MyMenu").Delete On Error GoTo 0 With Application.CommandBars.Add(Name:="MyMenu", Position:=msoBarPopup, _ temporary:=True)
'OnActionプロパティで先述の標準Moduleのマクロを登録します
With .Controls.Add(Type:=msoControlButton, temporary:=True) .Caption = "訂正" .FaceId = 21 .OnAction = "R_ClkCut" End With
With .Controls.Add(Type:=msoControlButton, temporary:=True) .Caption = "削除" .FaceId = 19 .OnAction = "R_ClkCopy" End With