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

[µo°Ý] ¦p¦ó§ó§ïºô­¶¤¤ªºOPTION§@¨ú±o¸ê®Æ©MÂà´«ÁcÅ餤¤å°ÝÃD

[µo°Ý] ¦p¦ó§ó§ïºô­¶¤¤ªºOPTION§@¨ú±o¸ê®Æ©MÂà´«ÁcÅ餤¤å°ÝÃD

¥»©«³Ì«á¥Ñ ¤p«L«È ©ó 2015-7-10 10:33 ½s¿è

¤j®a¦n¡A§Ú¥´ºâ¨ìSINA CNªººô¯¸¨ú±o°]°È¸ê®Æ¡G
http://stock.finance.sina.com.cn/hkstock/finance/00001.html

·í¤¤ªº¸ê®Æ¤w¸g±Æ¦n¡Aºâ¬O«Ü¦n¨ú±o¡C¦ý³oºô¯¸ªº¡u³øªíÃþ«¬¡v¹w³]¬O¡u¥þ³¡¡v¡A©Ò¥H·|¦P®ÉÅã¥Ü¦~³ø©M¤¤³ø¸ê®Æ¡A¦]¬°Äæ¦ì©Ò­­(8­Ó)¡A¥u·|Åã¥Üªñ¥|¦~ªº¸ê®Æ¡C¦pªG§â¡u³øªíÃþ«¬¡v§ï¦¨¡u¦~³ø¡v¡A§Ú«K¥i¥H¨ú±oªñ¤K¦~ªº¸ê®Æ¡C¥Ñ©ñ­n§ó§ïºô­¶ªºSELECT OPTION¡A©Ò¥H¤£¯à¥ÎQueryTablesªº¤èªk¡C

§Ú¹Á¸Õ¥Î¥H¤UCODING¡A¬O¥i¥H§ï¨ì¡u³øªíÃþ«¬¡v¦¨¦~³ø¡A¦ý¸ê®Æ¨S¦³§ó·s¡C
  1. Sub getData()
  2.     Dim URL As String, A As Object, B As Object, i As Integer
  3.     URL = "http://stock.finance.sina.com.cn/hkstock/finance/00001.html"
  4.     With CreateObject("InternetExplorer.Application")
  5.         .Visible = True     '  ¬O§_Åã¥Ü IE
  6.         .Navigate URL
  7.         Do While .readyState <> 4
  8.             DoEvents
  9.         Loop
  10.         Set A = .document.getelementsbytagname("SELECT")
  11.         A.Item(1).Value = "zero"    '¦~³ø
  12.         Cells(1, 1) = .document.body.innerhtml
  13.         .Quit
  14.     End With
  15. End Sub
½Æ»s¥N½X
¦ý°²¦p§Ú¦b¡uSet A = .document.getelementsbytagname("SELECT")¡v³o¥y¼È°±µ{¦¡¡A¤â°Ê§ó§ï¡u³øªíÃþ«¬¡v¡Aµ²ªG¬O¥i¥H®³¨ì¤K¦~µ²ªG¡C½Ð°Ý¦U¦ì¤j¤j¥i¥H«ü±Ð§Ú¶Ü¡HÁÂÁ¤j®a¡C

¥t¥~¡A§Ú§ä¨ì¤èªk¥i¥H¥Îexcel¤º¸m¥\¯à§â²ÅéÂàÁcÅé¡A¦ý¬O³o¥\¯à­n§Ú¥ýÀx¦sWORKBOOK©Î¤â°Ê½T©w¡uÂà´«®É¥¼Àx¦s¡v¡A¬°¤F¯à°÷§å¦¸°õ¦æ¡A©Ò¥H§Ú¥[¤W¤Fthisworkbook.save³o¥y¡A½Ð°Ý°£¤F³o¤èªk¥~¡A¦³¨S¦³¤£¥ÎÀx¦s¡B¤£¥Î½T»{ªºÂà´«¤èªk¡HÁÂÁ¤j®a¡C
  1.     Set ConvertObj = Application.COMAddIns("TCSCConv.SharedAddin.14").Object
  2. thisworkbook.save
  3.     ConvertObj.DoSC2TC
½Æ»s¥N½X

²ÁcÂà´«¼W¯q¶°
http://www.microsoft.com/zh-tw/download/details.aspx?id=18514

TOP

¦^´_ 1# ¤p«L«È


    ¥i°Ñ¦Ò³o¸Ì
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# jackyq


    ÁÂÁ§A¡A¥i¬O³o­Ó¬OFOR EXCEL 2003 ONLY¡A§Ú²{¦b¬O¥ÎEXCEL 2010¡A¯à°÷¨Ï¥Î¶Ü¡H

TOP

¦^´_ 3# GBKEE


    ÁÂÁª©¤j¡A¨S¦³¯d·N¤§«e¦³Ãþ¦üªºµo°Ý¡A§Ú¥ý¬ã¨s¡A¬Ý¬Ý¯à§_¸Ñ¨M¡C

TOP

§Ú¨S¦³ 2010
§A¥i¥H¸Õ¸Ë¬Ý¬Ý
¦pªG¥i¥H¸Ë«o¬Ý¤£¨£«ö¶s
https://support.microsoft.com/zh-tw/kb/2459493/zh-tw

TOP

¦^´_ 6# jackyq

¨ä¹êEXCEL 2010¦³¤º¸mªºÁc²Âà´«¥\¯à¡A¤W­±ªº¥N½X¤]¬O¤Þ¥Î¤º¸m¥\¯à§@Âà´«¡A¥i±¤¨Ï¥Î³o¥\¯à®É·|´£¥Ü¥Î®a¤å¥ó¥¼Àx¦s¡A§@LOOPING®É¦³ÂI³Â·Ð¡C
¥Ñ©ó§Ú¥Îªº¬O¤½¥q¹q¸£¡A­n¦^®a§@¯à¦w¸Ëªþ¥ó¡A§Ú¦^®a¸Õ¸Õ§a¡A¥ýÁÂÁ§AªºÀ°¦£¡C

TOP

¦^´_ 3# GBKEE


    GEKEE¤j¡A§Ú¤½¥q¹q¸£¬O¥ÎWIN 7 ©MIE 8 ¡A¨Ï¥Î§A¤¶²ÐªºPOST¤¤ªºCODING¦³ÂI°ÝÃD¡G
  1. Sub Ex()
  2.     Dim my_url As String, A As Object
  3.     my_url = "http://stock.finance.sina.com.cn/hkstock/finance/00001.html"
  4.     With CreateObject("InternetExplorer.Application")
  5.         .Visible = True
  6.         .Navigate my_url
  7.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  8.         Set A = .document.getElementsByTAGName("SELECT")
  9.         A.Item(1).Value = "zero"    '¦~³ø
  10.         A.fireEvent ("onchange")
  11.         Cells(1, 1) = A.document.body.innerhtml
  12.    End With
  13. End Sub
½Æ»s¥N½X
§Ú¥Î§AªºCODE§ï¤Fºô§}¡A¦b°õ¦æ¡uA.fireEvent ("onchange")¡v³o¥y¥X²{°ÝÃD¡A¬Oºô¯¸ªº³]­p°ÝÃD¶Ü¡H

TOP

¦^´_ 8# ¤p«L«È

A.fireEvent ("onchange") ¤£¦æ.
¨º¸ÌÁÙ¦³°Q½×¦A¬Ý¬Ý¸Õ¸Õ.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ ¤p«L«È ©ó 2015-7-13 11:35 ½s¿è

¦^´_ 9# GBKEE

¹ï¤£°_¡AfireEvent¬O¨S°ÝÃD¡A§Ú­×§ï¤F«K¥i¥H¤F¡AÁÂÁÂGEKEE¤j¤j¡C
¥t¥~¡A²ÁcÂà´«¦³¨S¦³¨ä¥L²³æ¸Ñ¨M¤èªk¡H

TOP

        ÀR«ä¦Û¦b : ·R¤£¬O­n¨D¹ï¤è¡A¦Ó¬O­n¥Ñ¦Û¨­ªº¥I¥X¡C
ªð¦^¦Cªí ¤W¤@¥DÃD