- ©«¤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
|
¦^´_ 1# dechiuan999 - Option Explicit
- Sub Ex_ӪѤ馨¥æ¸ê°T()
- Dim i As Integer, s As Integer, k As Integer, A As Object, ii, j
- Dim STK_NO As String 'ªÑ²¼¥N½X INPUT
- ' Dim myear As String '¦~«× SELECT
- ' Dim mmon As String '¤ë¥÷ SELECT
- STK_NO = "2485"
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .navigate "http://www.twse.com.tw/ch/trading/exchange/STOCK_DAY/STOCK_DAYMAIN.php"
- Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
- With .document
- .getelementsbytagname("INPUT")("STK_NO").Value = STK_NO
- .getelementsbytagname("SELECT")("myear").Value = Year(Date) '2014
- .getelementsbytagname("SELECT")("mmon").Value = Month(Date) '7 ¤ë
-
- '.getelementsbytagname("SELECT")("myear").Value = Year(Date) - 1 '2013
- '.getelementsbytagname("SELECT")("mmon").Value = Month(Date) - 1 '6 ¤ë
-
- .getelementsbytagname("INPUT")("login_btn").Click
- End With
- Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
- Do
- Set A = .document.getelementsbytagname("table")
- Loop While A Is Nothing
- If InStr(A(6).innertext, "¬dµL¸ê®Æ:") Then
- MsgBox A(6).innertext
- Else
- With ActiveSheet
- .Cells.Clear
- For i = 0 To A(7).Rows.Length - 1 '¼g¤J¸ê®Æ
- k = k + 1
- For j = 0 To A(7).Rows(i).Cells.Length - 1
- .Cells(k, j + 1) = A(7).Rows(i).Cells(j).innertext
- Next
- Next
- End With
- End If
- .Quit 'Ãö³¬ºô¶
- End With
- End Sub
½Æ»s¥N½X |
|