- ©«¤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
|
¦^´_ 2# super16666
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex() '¹Ò¥~µ²ºc«¬°Ó«~¸ê°TÆ[´ú¯¸(¸ê°T¤½§i¥¥x)
- Dim E As Variant, Sh As Worksheet, xRow As Double, xTable As Object, xTable_Msg As Boolean
- Dim i As Integer, xPag As Integer, xPag_All As Integer, xR As Integer, xC As Integer
- Set Sh = ActiveSheet
- Sh.Cells.Clear
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .Navigate "http://structurednotes-announce.tdcc.com.tw/Snoteanc/apps/bas/BAS210.jsp"
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- For i = 1 To .Document.all("AGENT_CODE").Length - 1
- .Document.all("AGENT_CODE")(i).Selected = True
- For Each E In .Document.all.tags("INPUT")
- If E.Type = "button" And E.Value = "¬d¸ß" Then E.Click '' input type="button" value="¬d¸ß"
- Next
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- xRow = xRow + 1
- Sh.Range("a" & xRow) = .Document.all("AGENT_CODE")(i).innertext
- If InStr(.Document.body.innertext, "©Ò¿é¤J¤§¬d¸ß±ø¥ó¬dµL¬ÛÃöªº¸ê®Æ") Then
- xRow = xRow + 1
- Sh.Range("a" & xRow) = "¬dµL¬ÛÃöªº¸ê®Æ"
- Else
- xPag_All = 1
- For Each E In .Document.all.tags("img")
- If InStr(E.href, "fp.gif") Then
- E.onclick '«e©¹ ²Ä¤@¶ ªº«öÁä
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- Exit For
- End If
- Next
- For Each E In .Document.all.tags("img")
- If InStr(E.href, "lp.gif") Then
- xPag_All = Split(E.onclick, "'")(1) '©¹³Ì«á¤@¶«öÁä: Ū¨ú(Á`¶¼Æ)
- Exit For
- End If
- Next
- xTable_Msg = True
- xPag = 0
- Do
- '**********´ú¸Õ¬d¬Ý¤ñ¹ï©Ò¤U¸ü¶¼Æ¸ê®Æ**********
- xRow = xRow + 1
- Sh.Range("a" & xRow) = .Document.all("AGENT_CODE")(i).innertext & " ¤U¸ü ²Ä " & xPag + 1 & " ¶ ¦@ " & xPag_All & " ¶"
- Sh.Range("a" & xRow).Select
- '***********µL»~«á µ{¦¡½X¥iµù¸Ñ±¼*******************************
- Application.StatusBar = .Document.all("AGENT_CODE")(i).innertext & " ¤U¸ü ²Ä " & xPag + 1 & " ¶ ¦@ " & xPag_All & " ¶"
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- Set xTable = .Document.all.tags("TABLE")(2)
- For xR = IIf(xTable_Msg, 0, 2) To xTable.Rows.Length - 1
- xRow = xRow + 1
- For xC = 0 To xTable.Rows(xR).Cells.Length - 1
- Sh.Cells(xRow, xC + 1) = IIf(xC = 0, "'", "") & xTable.Rows(xR).Cells(xC).innertext
- Next
- Next
- xTable_Msg = False
- For Each E In .Document.all.tags("img")
- If InStr(E.href, "np.gif") Then E.Click
- Next
- xPag = xPag + 1
- Loop Until xPag_All = xPag
- End If
- Next
- .Quit 'Ãö³¬ºô¶
- End With
- Application.StatusBar = " ¤U¸ü Ok"
- End Sub
½Æ»s¥N½X |
|