- ©«¤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 ©ó 2016-4-26 10:25 ½s¿è
¦^´_ 9# BigDog
2016/4/26 §ó·s- Option Explicit
- Sub ¹d¦ëºô_¸³ºÊ«ùªÑ()
- Dim ie As Object, A As Object, T As Date, i As Integer, c As Integer
- Dim Code As String, xMonth As String
- Code = InputBox("¿é¤JªÑ²¼¥N¸¹ : ", "ªÑ²¼¥N¸¹", 2303)
- xMonth = InputBox("¿é¤J¦~¤ë : ", "¦~¤ë", Format(DateAdd("M", -2, Date), "yyyy¦~m¤ë"))
- Set ie = CreateObject("InternetExplorer.Application")
- ie.Navigate "http://www.cnyes.com/twstock/directorholder/" & Code & ".htm"
- ' ie.Visible = True
- Do While ie.Busy Or ie.ReadyState <> 4: DoEvents: Loop
- With ie.Document
- With .getElementById("ctl00_ContentPlaceHolder1_DropDownList1")
- .Value = xMonth
- .fireEvent ("onchange")
- End With
- Do While ie.Busy Or ie.ReadyState <> 4
- DoEvents
- Loop
- On Error Resume Next
- Do
- DoEvents
- Set A = .getelementsbytagname("table")(1)
- If Not A Is Nothing Then
- If InStr(A.innertext, Format(xMonth, "YYYYM")) Then
- If Err Then
- Debug.Print Err
- Err.Clear
- Else
- Exit Do
- End If
- End If
- End If
- Loop
- On Error GoTo 0
- Cells.Clear
- Cells(1, "A").Resize(, 4) = Array("ªÑ²¼¥N¸¹", Code, "¤ë¥÷", xMonth)
- For i = 0 To A.Rows.Length - 1
- For c = 0 To A.Rows(i).Cells.Length - 1
- Cells(i + 2, c + 1) = A.Rows(i).Cells(c).innertext
- Next
- Next
- End With
- ie.Quit
- MsgBox "OK"
- End Sub
½Æ»s¥N½X |
|