ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

½Ð°Ý §Ú¤w¸g¼g¦n¥i¥H¨Ï¥Îªºvba ­n´«³o¤@¬qºô§} «oµLªk¦¨¥\ ½Ð°Ý¥i¥H¨¹§Ú¬Ý¬Ý¶Ü¡H

½Ð°Ý §Ú¤w¸g¼g¦n¥i¥H¨Ï¥Îªºvba ­n´«³o¤@¬qºô§} «oµLªk¦¨¥\ ½Ð°Ý¥i¥H¨¹§Ú¬Ý¬Ý¶Ü¡H

Option Explicit
Sub EX()
    Dim xDate As Date, genpage As String, qdate As String, Print_php As String, Wb As Workbook
   
    '1 ¦p¤£¥i¬d¸ß·í¤é ¤T¤jªk¤H¶R½æ¶W¤é³ø
    xDate = Date - 1
   
   
    Do While Weekday(xDate, vbMonday) >= 6
        xDate = xDate - 1
    Loop
   
    '¦p©ó¤@©wªº®É¶¡«á¥i¬d¸ß·í¤éªº ¤T¤jªk¤H¶R½æ¶W¤é³ø
    '½Ð§R°£ ** xDate = Date - 1 **
   
   
    '2 °õ¦æ¤U­±ªºµ{¦¡½X,¨ú®øµù¸Ñ ** ' **
   
    'If xDate = Date And Time < #5:00:00 PM# Then
    '    xDate = xDate - 1
    'End If
   
    For Each Wb In Workbooks
        If Trim(Wb.Name) = "print.php" Then Wb.Close False
        '¤U¸üCSV ªº¦WºÙ¬° Print_php ¥²¥ýÃö³¬
    Next
    genpage = Format(xDate, "yyyymm/yyyymmdd")
    qdate = Format(xDate, "yyyymmdd")
    Print_php = "http://www.twse.com.tw/ch/trading/fund/T86/print.php?edition=ch&filename=genpage/" _
             & genpage & "_2by_issue.dat&type=csv&select2=ALLBUT0999&qdate=" & qdate

     Set Wb = Workbooks.Open(Print_php)
End Sub





¥H¤W¬O¤j¤j¨¹§Ú¼g±o
¦ý§Ú²{¦b­n§âºô§}§ï¦¨
http://www.twse.com.tw/ch/trading/exchange/TWTB4U/TWTB4U_print.php?language=ch&save=csv

«o¨S¦³¸ê®Æ ½Ð°Ý¬O­þÃä¥X¤F°ÝÃD©O?

        ÀR«ä¦Û¦b : ¤f»¡¤@¥y¦n¸Ü¡A¦p¤f¥X½¬ªá¡F¤f»¡¤@¥yÃa¸Ü¦p¤f¦R¬r³D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD