¤WÂd ӪѤ馨¥æ¸ê°T §ì¨ú°ÝÃD
- ©«¤l
- 15
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 27
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- Win7
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-9-12
- ³Ì«áµn¿ý
- 2016-2-15
|
¤WÂd ӪѤ馨¥æ¸ê°T §ì¨ú°ÝÃD
Hi ¦U¦ì¤j¤j¤¤¬î§Ö¼Ö
³Ìªñ§Ú§Q¥Î°²¤é·Q§ì¨ú ¤WÂd ӪѤ馨¥æ¸ê°T¡A³¡¤Àµ{¦¡½X¦p¤U¡A°õ¦æ¤§«á¡A¦³®ÉÔ·|°±¦b¹Ï±¬õ®Øªº¦a¤è¡AÅã¥ÜµL¸ê®Æ¡A¦ý¦³ªº®ÉÔ¤S¥i¥H¶]¥X¦¨¥æ°T®§
¦Ó³oÓ¦a¤èªºµ{¦¡½X¡A§Ú§ä¤£¨ì·j´Mªº«ö¶s¡A©Ò¥Hcopy GKEBB¤j¤j¤§«e¦³¤@¬qªº»yªk A.Focus Application.SendKeys "~"
·Q½Ð°Ý¦U¦ì¥ý¶i¡A³o¤@¬q§ÚÀ³¸Ó«ç»ò§ï¶i·|¤ñ¸û¦n?
'------------------------------------------- ¡i¤WÂd¤½¥q¡j------------------------------------------------------
'------------------------- ´M§ä²M³æ¤¤¦³¦h¤Ö¤é´Á(¤ë) »Ýn®i¦¬´M
Set monthrange = Sheets("²M³æ").Range("D65536").End(xlUp) 'ªí¥Ü´M§ä A Ä檺 stock ªº³Ì«á¤@¦C
For searchmonthrange = 2 To monthrange.Row 'Stock ªº°õ¦æ½d³ò¡A±q²Ä 2 ¦æ¶}©l°õ¦æ¡A¨ì³Ì«á¤@¦æ
myyearwest = Sheets("²M³æ").Cells(searchmonthrange, 3) 'ªÑ»ù¦è¤¸¦~
myyeareast = Sheets("²M³æ").Cells(searchmonthrange, 3) - 1911 'ªÑ»ù¥Á°ê¦~
mymonth = Sheets("²M³æ").Cells(searchmonthrange, 4) 'ªÑ»ù¤ë
yearmonth = myyeareast & "/" & mymonth
'------------------------- ¥´¶}ªÑ²¼ºô¶
With CreateObject("InternetExplorer.Application") '¶}±ÒÃÒ¨éÂd»O¶R½æ¤¤¤ßºô¶
.Visible = True
.Navigate "http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43.php?l=zh-tw"
Do While .Busy Or .readyState <> 4: DoEvents: Loop
With .document
'--------------------¿é¤Jn¬d¸ßªº¤é´Á
For Each A In .getelementsbytagname("INPUT") '§äì©l½X¦³input°Ñ¼Æ
If A.Name = "input_date" Then A.Value = yearmonth
Next
'--------------------¿é¤Jn¬d¸ßªºªÑ²¼¥N½X
For Each A In .getelementsbytagname("INPUT") '§äì©l½X¦³input°Ñ¼Æ
If A.Name = "input_stock_code" Then A.Value = stockcode
Next
'--------------------¿é¤Jn¬d¸ßªºªÑ²¼¥N½X
For Each A In .getelementsbytagname("INPUT") '§äì©l½X¦³input°Ñ¼Æ
If A.ID = "input_stock_code" Then
A.Focus
Application.SendKeys "~"
End If
Next
End With
Application.Wait Now + #12:00:05 AM# 'µ¥«Ýºô¶¤U¸ü¸ê®Æ |
|
|
|
|
|
|
- ©«¤l
- 15
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 27
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- Win7
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-9-12
- ³Ì«áµn¿ý
- 2016-2-15
|
Hi GBKEE ¤j¤j
ÁÂÁ§A¡A§Ú¥Ø«e¦bIE8ªººô¶¥i¥H¾Þ§@¡A¤£¹L§Ú·Q½Ð±Ð¤@Ó°ÝÃD¡A¬°¤°»ò¨Ï¥ÎfireEvent ("onchange")¤§«á¡A³Ì«á¤@¬qVBA¡A§Ú¥Î'Do While .Busy Or .readyState <> 4: DoEvents: Loop¡A³oÓ»yªk¡A¦³®ÉÔºô¶·|µLÅã¥Ü¸ê®Æ¡A¦Ón§ï¥ÎApplication.Wait Now + #12:00:03 AM#¡A¤~¤ñ¸ûéO¡A¨C¦¸³£¦³¸ê®Æ? ¬O¤£¬OnÅýºô¶µ¥«Ý
=============¥H¤U¬°VBA===================
'------------------------- ¥´¶}ªÑ²¼ºô¶
With CreateObject("InternetExplorer.Application") '¶}±ÒÃÒ¨éÂd»O¶R½æ¤¤¤ßºô¶
.Visible = True
.Navigate "http://www.tpex.org.tw/web/stock/aftertrading/daily_trading_info/st43.php?l=zh-tw"
Do While .Busy Or .readyState <> 4: DoEvents: Loop
With .document
'--------------------¿é¤Jn¬d¸ßªºªÑ²¼¥N½X
For Each A In .getelementsbytagname("INPUT") '§äì©l½X¦³input°Ñ¼Æ
If A.Name = "input_stock_code" Then A.Value = stockcode
Next
'--------------------¿é¤Jn¬d¸ßªº¤é´Á
For Each A In .getelementsbytagname("INPUT") '§äì©l½X¦³input°Ñ¼Æ
If A.Name = "input_date" Then
A.Value = yearmonth
A.fireEvent ("onchange")
End If
Next
End With
Application.Wait Now + #12:00:03 AM# 'µ¥«Ýºô¶¤U¸ü¸ê®Æ
'Do While .Busy Or .readyState <> 4: DoEvents: Loop |
|
|
|
|
|
|