- ©«¤l
- 361
- ¥DÃD
- 57
- ºëµØ
- 0
- ¿n¤À
- 426
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- 2003,2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-13
- ³Ì«áµn¿ý
- 2022-12-8
|
¦^´_ 5# c_c_lai
¿à¤j¸Õ¸Õ¡A§Ú¥u·|®³¥H«eªº¨Ó§ï
- Sub ÃÒ¥æ©Ò()
-
- Dim strText As String
- Dim i As Integer
- Dim j As Integer
- Dim nRow As Integer
- Dim xRow As Integer
- Dim nCol As Byte
- Dim TR As Object
- Dim TD As Object
- Dim Arr()
- Cells.Clear
-
- With CreateObject("winhttp.winhttprequest.5.1")
- .Open "POST", "http://www.twse.com.tw/ch/trading/exchange/TWTB4U/TWTB4U.php", False
- .setrequestheader "Referer", "http://www.twse.com.tw/ch/trading/exchange/TWTB4U/TWTB4U.php"
- .setrequestheader "Content-Type", "application/x-www-form-urlencoded"
- .Send "input_date=105%2F06%2F15&select2=21&login_btn=+%ACd%B8%DF+"
- strText = BinToStr(.ResponseBody, "BIG5") 'nª`·Nºô¶½s½X
- End With
-
- With CreateObject("htmlfile")
- .Write strText
- Set hTable = .all.tags("table")(8)
- tt = hTable.Rows.Length
- With ActiveSheet
- For i = 0 To hTable.Rows.Length - 1
- For j = 0 To hTable.Rows(i).Cells.Length - 1
- .Cells(i + 1, j + 1) = hTable.Rows(i).Cells(j).innertext
- Next
- Next
- End With
-
- End With
- End Sub
- Function BinToStr(arrBin, strChrs)
- With CreateObject("ADODB.Stream")
- .Type = 2
- .Open
- .Writetext arrBin
- .Position = 0
- .Charset = strChrs
- .Position = 2
- BinToStr = .ReadText
- .Close
- End With
- End Function
½Æ»s¥N½X |
|