以下是我下載的程式。
===========使用web下載至sheet上====================
Sub 下載每日股價Web_1()
Dim WbSht融資融卷 As Worksheet
Dim WebShtDailyVal As Worksheet
Dim TwseURL_daily$
'' Dim Workday As Integer
'' Dim Response
WorkDay = Application.Evaluate("WEEKDAY(TODAY())-1")
''
'' If Workday = 6 And flag = 0 Then
'' m = m - 1
'' m = "0" & m
'' End If
Set WbSht融資融卷 = Sheets("融資融卷")
Set WebShtDailyVal = Sheets("每日股價")
Select Case Month(Now)
Case 1, 2
startYear = Year(Now) - 1
startMon = 10
Case 3, 4
startYear = Year(Now) - 1
startMon = 11
Case Else
startYear = Year(Now)
startMon = Month(Now) - 4
End Select
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''融資融卷下載開始'''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If flag = False Then