- ©«¤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# ¬¡¤O¥R¨K
·s¶}¬¡¶Ã¯ ´¡¤J¤@ªí³æ : ¥[¤J ¤T±±¨î¶µ WebBrowser1 , CommandButton1 , CommandButton2
°õ¦æªí³æ: 1) WebBrowser1¤¤: ¿ï¾Ü ¤é´Á ,¤ÀÃþ¶µ¥Ø ,«ö¤U¬d¸ß
2)«ö¤Uªí³æªºCommandButton1
ªí³æªºµ{¦¡½X
- Option Explicit
- Dim Sh As Worksheet, IE As Object
- Private Sub UserForm_Initialize()
- Set Sh = ActiveSheet '«ü©w¤u§@ªí: ¼g¤J¸ê®Æ
- With WebBrowser1
- .Navigate "http://www.twse.com.tw/ch/trading/fund/T86/T86.php" '«ü©wºô§}
- Do While .Busy = True
- DoEvents
- Loop
- End With
- Set IE = WebBrowser1.Document
- End Sub
- Private Sub CommandButton1_Click() '¼g¤J¸ê®Æ
- Dim i, k, j
- Sh.UsedRange.Clear
- On Error Resume Next
- For i = 0 To IE.getElementsByTagName("table")(8).Rows.Length - 1
- k = k + 1
- For j = 0 To 13
- Sh.Cells(k, j + 1) = IE.getElementsByTagName("table")(8).Rows(i).Cells(j).innerText
- Next
- Next
- Sh.Columns.AutoFit
- Sh.Range("A1").ColumnWidth = 15
- End Sub
- Private Sub CommandButton2_Click() 'µ²§ôµ{¦¡
- Unload Me
- End Sub
½Æ»s¥N½X |
|