Está en la página 1de 15

1

Excel 2017523Excel
12
PDF

1 Step 02

Step 01
www.twse.com.
tw

122 123
1


Excel

Step 03 Step 05
Excel
Ctrl+C Excel 1
1

Step 06
Step 04
CFICode

124 125
1


Excel

Step 07 Step 08
Step 7 /HTML6505
www.twse.com.tw/
6505 exchangeReport/FMNPTK?response=html&stockNo=6505

2017 5 30 106

126 127
1


Excel

Step 09 Step 10
Excel VBA Excel ALT+F11 Visual Basic for Application Step 9
Excel (*.xlsm) Sub 1Sub TWSE_PRICE_
.xlsm YEAR theTicker
Web VBA

Excel QueryTable Web
Step10

128 129
1


Excel

Step 11 Step 12
Step11 /HTML6505
www.twse.com.tw/zh/page/trading/exchange/ www.twse.com.tw/
STOCK_DAY.html exchangeReport/STOCK_DAY?response=html&date=20170531&stock
No=6505

130 131
1


Excel

Step 13 Step 14
Excel ALT+F11 Visual Basic for Application
Sub TWSE_PRICE_YEAR(theTicker)Sub TWSE_PRICE_ Sub TWSE_PRICE_DAY2YEAR() VBA
DAY(theTicker) VBA
1 For-Next 3
VBA Call TWSE_PRICE_YEAR(theTicker)Call TWSE_PRICE_
DAY(theTicker)Call TWSE_PRICE_DAY2YEAR

132 133
1


Excel

Step 15 Step 16
IE F12DOM
www.tpex.org.tw HTML FORM POST
SERVER st42.php?l=zh-tw
1565Enter input_stock_code1565 POST
www.tpex.org.tw/web/stock/ input_stock_code =1565
statistics/monthly/st42.php?l=zh-tw

134 135
1


Excel

Step 17 Step 18
Excel ALT+F11 VBA Sub TWSE_PRICE_ Excel 2 B2
YEAR(theTicker) Sub TPEX_PRICE_YEAR(theTicker) C2 2330 C2
SERVER C2theTicker
POST VBA

136 137
1


Excel

Step 19 X
CEL


E
Excel ALT+F11 VBA

Forms HTML
VBA Form Elements
C2 Web Server

C2 Worksheet_Change

VBA A
2
GET POST
Step 1 / GET
POST

GET
URL

POST URL

GET
Yahoo! tw.stock.yahoo.com2330
tw.stock.yahoo.com
w.stock.yahoo.com/q/q?s=2330 Yahoo!
GET s=2330

138 139
1


Excel

CEL
X

POST
TDCC www.
tdcc.com.tw/smWeb/QryStock.jsp
www.tdcc.com.tw/smWeb/QryStock.jsp
www.tdcc.com.tw/smWeb/QryStock.jsp
POST
POST
IE 11
DOM

140 141
2 8


Excel

2 Step 02
/HTML 6505

8
www.twse.com.
tw/exchangeReport/FMSRFK?response= html&date=20170601&stock


No=6505


.xlsm

Step 01
IE
6505

142 143
2 8


Excel

Step 03 Step 04
IE Excel PRICE_
M ALT+F11 VBA Sub TWSE_PRICE_ VBA
YEAR(theTicker)Sub TWSE_PRICE_MONTH(theTicker) TWSE_PRICE_MONTH_DATA_CLEAN
8 For-Next
VBA

144 145
2 8


Excel

Step 05 Step 06
IE IE F12
www.tpex.org.tw/ DOM )
web/stock/statistics/ monthly/st44.php?l=zh-tw POST input_stock_
code=1565&yy=2016

146 147
2 8


Excel

Step 07 Step 08
DOM query() javascript IE Excel ALT+F11 VBA
query() Server Module1 Sub TPEX_PRICE_YEAR(theTicker)Sub TPEX_
Step 6 POST input_ PRICE_MONTH(theTicker) 8
stock_code=1565&yy=2016 ajax=true&l=zh-tw& input_stock_ For-Next VBA
code=1565&yy=2016Server st44.php?l=zh-tw
result_st44.php?l=zh-tw

148 149
2 8


Excel

Step 09 Step 10
8 4
VBA
TPEX_PRICE_MONTH_DATA_CLEAN

PRICE_YPRICE_M VBA

150 151

También podría gustarte