- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-8-8 09:51 ½s¿è
¦^´_ 17# ciboybj
¦³¨Ç¬d¸ß¸ê®Æ(¨Ò¦p¬d¸ß"¹q¸£")·|¦³¤U¤@¶ªº°ÝÃD
þn¥ý¬Ý³oºô¶ªºì©l¤å¥ó [¤U¤@¶]Á䪺¦WºÙ.- Sub ¤é³øªí()
- Dim D As Object, E As Object, P As Integer, URL As String, ¶¼Æ As Integer, i As Integer
- Dim P_down As Object
- URL = "http://bsr.twse.com.tw/bshtm/"
- With CreateObject("InternetExplorer.Application")
- .Navigate URL
- .Visible = True
- Do While .readyState <> 4 Or .Busy
- DoEvents
- Loop
- Set D = .Document.all(5).all(0).contentWindow.frames.Document.getelementsbytagname("INPUT")
-
- D("txtTASKNO").Value = "1101"
- For Each E In D
- If E.Value = "¬d¸ß" Then E.Click: Exit For
- Next
- Do While .readyState <> 4 Or .Busy
- DoEvents
- Loop
- ¶¼Æ = .Document.all(5).all(0).contentWindow.frames.Document.getElementsByName("sp_ListCount")(0).INNERTEXT
- For Each E In .Document.all(5).all(0).contentWindow.frames.Document.getelementsbytagname("INPUT")
- If E.Value = "¤U¤@¶" Then Set P_down = E: Exit For
- Next
- ActiveSheet.Cells.Clear
- .Document.Focus
- For P = 1 To ¶¼Æ
- Set D = Nothing
- Do
- DoEvents
- Set D = .Document.all(5).all(1).contentWindow.frames.Document.getelementsbytagname("table") '
-
- Loop Until Not D Is Nothing And D.Length = 7
- For i = IIf(P = 1, 3, 4) To 4
- Ep D(i).outerHTML
- Next
- P_down.Click
- Do While .readyState <> 4 Or .Busy
- DoEvents
- Loop
- Next
- .Quit
- End With
- End Sub
- Private Sub Ep(s As String) ' A(A.Length - 1).outerHTML
- With CreateObject("InternetExplorer.Application")
- .Navigate "about:Tabs"
- .Visible = True
- .Document.body.innerHTML = s
- .ExecWB 17, 2 ' Select All
- .ExecWB 12, 2 ' Copy selection
- With ActiveSheet
- ' MsgBox .UsedRange.Rows.Count
- .Range("A" & IIf(.UsedRange.Rows.Count = 1, 1, .UsedRange.Rows.Count + 1)).Select
- .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
- End With
- .Quit
- End With
- End Sub
½Æ»s¥N½X |
|