- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 17# GBKEE
´ú¸Õ¥Î (¤w®M¥Î±z«Øij¤§¨ç¼Æ)- Sub Test()
- Dim xTable As Object, k As Integer, C As Integer, R As Integer ' , sn As Integer
- Dim url As String, cts As Integer, E As Variant, xDate As String ' , rc As Integer
- Dim oXmlhttp As Object, oHtmldoc As Object, select2 As String ' , tm
- Dim TVal() As Variant
-
- If Select_Name = -1 Then Exit Sub
- TVal = Array("MS", "ALL", "0049", "0099P", "019919T", "0999", "0999P", "01", "02", "03", _
- "04", "05", "06", "07", "21", "22", "08", "09", "10", _
- "11", "12", "13", "24", "25", "26", "27", "28", "29", _
- "30", "31", "14", "15", "16", "17", "18", "23", "9299", "19", "20", "CB")
-
- xDate = Format(Sheets("Á`ªí").[B1], "EE/MM/DD")
- url = "http://www.twse.com.tw/ch/trading/exchange/MI_MARGN/MI_MARGN.php?qdate=" & xDate & "&selectType=" & TVal(Select_Name)
- 'url = "http://www.twse.com.tw/ch/trading/exchange/MI_MARGN/MI_MARGN.php?qdate=" & xDate & "&selectType=" & Select_Name
- 'url = "http://www.twse.com.tw/ch/trading/exchange/MI_MARGN/MI_MARGN.php?qdate=" & xDate & "&selectType=¤ôªd¤u·~"
- Set oXmlhttp = CreateObject("msxml2.xmlhttp")
- Set oHtmldoc = CreateObject("htmlfile")
- With oXmlhttp
- .Open "Get", url, False
- .Send
-
- Do While .Status <> 200 Or .readyState <> 4: DoEvents: Loop
-
- oHtmldoc.write .responseText
- 'MsgBox .responseText
- End With
-
- Set xTable = oHtmldoc.ALL.tags("TABLE")
- ' Stop
- ' ¬Ý¬Ý°Ï°ìÅܼƵøµ¡ xTable ªº¤º®e
- Set xTable = oHtmldoc.ALL.tags("TABLE")(0)
- ' Stop
- ' ¦A¦¸¬Ý¬Ý°Ï°ìÅܼƵøµ¡ xTable ªº¤º®e
- MsgBox xTable.INNERTEXT
- End Sub
- Private Function Select_Name() As Integer
- With Sheets("Á`ªí").ComboBox1
- If .ListIndex = -1 Then MsgBox ("±z©|¥¼¿ï¾Ü¡u²£·~Ãþ§O¡v¡A½Ð©ó" & vbCrLf & "½T»{«á¦A¦¸ÂI¿ï¡y¶}±Òºô¶¡z¡A" & vbCrLf & "ÁÂÁ±z¡I")
- Select_Name = .ListIndex ' Select_Name = -1,0,1,2,3,4,5,6,7,8,9,.....39
- End With
- End Function
½Æ»s¥N½X
|
|