- ©«¤l
- 34
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 71
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2012-11-12
- ³Ì«áµn¿ý
- 2022-5-2
  
|
¦^´_ 6# t8899
¦bwith ¸Ì±¥[¤W .AdjustColumnWidth = False¡A´N¦n¤F¡A¥i¥H¦Û¤v¥Î¿ý»s¥¨¶°¬Ý¬Ý¿ý¥X¤°»òµ{¦¡½X
Option Explicit
Sub TWSE_¥æ©ö¸ê°T()
Dim YMD_day As String, N As Name, webURL As String
YMD_day = InputBox("¿é¤J ¥Á°ê¦~«× : 102/10/07", "¤U¸ü¯S©w¤é´Áªº¸ê®Æ", Format(Date - 1, "E/MM/DD")) '¥Á°ê¦~«× "102/10/07"
With ActiveSheet '¥i«ü©w¤u§@ªí
'·í¤é¨R¾P¥æ©ö¼Ðªº¤Î²Îp
webURL = "URL;http://www.twse.com.tw/ch/trading/exchange/TWTB4U/TWTB4U.php?input_date=" & YMD_day & "&login_btn=¬d¸ß.dat"
'¹dÃB¥æ©ö¤é¦¨¥æ¸ê°T
'webURL = "URL; http://www.twse.com.tw/ch/trading/block/BFIAUU/BFIAUU.php?input_date=" & YMD_day & "&login_btn=¬d¸ß.dat"
'webURL = "URL; http://www.twse.com.tw/ch/trading/block/BFIAUU/BFIAUU.php?input_date=" & YMD_day & "&login_btn=%ACd%B8%DF.dat"
If .QueryTables.Count = 0 Then
.QueryTables.Add Connection:=webURL, Destination:=.Range("A1")
Else
.QueryTables(1).Connection = webURL
End If
.Cells.Clear
With .QueryTables(1)
.AdjustColumnWidth = False
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
' .WebTables = "data_table" '¹dÃB¥æ©ö¤é¦¨¥æ¸ê°T :¸ê®Æ¶×¤JªºTables
.WebTables = "9,11" '·í¤é¨R¾P¥æ©ö¼Ðªº¤Î²Îp :¸ê®Æ¶×¤JªºTables
.Refresh BackgroundQuery:=False
End With
End With
End Sub |
|