- ©«¤l
- 4
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 56
- ÂI¦W
- 0
- §@·~¨t²Î
- XP SP3
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2011-4-29
- ³Ì«áµn¿ý
- 2021-10-29
|
[µo°Ý] ¦p¦ó¥ÎVBA±±¨î¤WÂdӪѦ¨¥æºô¶option ±±¨î¶µ
¦U¤j¦n¡G
·Q½Ð±Ð¤@¤U¡A¦p¦ó¨Ï¥ÎVBA¨Ó±±¨î¤WÂdӪѦ¨¥æºô¶(http://www.otc.org.tw/web/stock/aftertrading/otc_quotes_no1430/stk_wn1430.php?l=zh-tw)
¤¤ Åã¥Ü "¥þ³¡"µ§ªº option ±±¨î¶µ¡Aºô¶¤¤½Ð¿ï¾ÜÃþªÑ»P¸ê®Æ¤é´Áªºoption ±±¨î¶µ¡A¤w¸g·|¨Ï¥ÎVBA¶i¦æ¾Þ±±¡A¥i¬OÅã¥Üµ§¼Æ¸ê®Æªºoption ±±¨î¶µ¦n¹³
»PTable ¦³ ¬ÛÃö³s¡A¬G¬Ý¹Lºô¶ªºì©l½X¤£ª¾¦p¦ó¨Ï¥ÎVBA¶i¦æ±±¨î¡A½Ð¦U¦ì¤j¤j«ü±Ð¡AÁÂÁ¡I
- Sub ½L«á¸ê°T_¤WÂd¨C¤é¦¬½L¦æ±¡()
- Dim A As Object, xDate As Date, EDATE As Date
- EDATE = Date
-
- xDate = EDATE
- '*************
- 'xDate = Date '¥¿¦¡±`µ{¦¡½X
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .Navigate "http://www.otc.org.tw/web/stock/aftertrading/otc_quotes_no1430/stk_wn1430.php?l=zh-tw"
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- Ie_Refresh:
-
- With .Document
- '¶ñ¤JÃþªÑ option "©Ò¦³ÃÒ¨é(¤£§tÅvÃÒ¡B¤ûºµÃÒ)"
- .ALL("sect").Value = "EW"
- .ALL("sect").onchange
- Application.Wait Now + TimeValue("00:00:03")
- '¶ñ¤J¸ê®Æ¤é´Á option
- .ALL("input_date").Value = Format(xDate, "E/MM/DD")
- .ALL("input_date").onchange
- Application.Wait Now + TimeValue("00:00:03")
- '?????
- 'Åã¥Ü "¥þ³¡"µ§¸ê®Æªº option VBA¦p¦ó¼g¡H¡H
- '?????
- End With
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- If InStr(.Document.BODY.innerText, "¬dµL¸ê®Æ") Then
- .Quit
- MsgBox Format(xDate, "E/MM/DD") & " ¬dµL¸ê®Æ"
- Exit Sub
-
- End If
- Set A = .Document.getElementsByTagName("table")
- .Document.BODY.innerHTML = A(0).outerHTML '¨ú"table"
-
- Do While .Busy Or .readyState <> 4: DoEvents: Loop
- .ExecWB 17, 2 ' Select All
- .ExecWB 12, 2 ' Copy selection
- .Quit 'Ãö³¬ºô¶
- With ActiveSheet '¥i«ü©w¤u§@ªí
- .UsedRange.Clear
- .Range("A1").Select
- .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NOHTMLFormatting:=True
- End With
- End With
- End Sub
½Æ»s¥N½X |
|