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

[µo°Ý] ¶°«O¤áªÑÅv¤À´²ªí¬d¸ß §ì¨C¶g¸ê®Æ

¦^´_ 20# chang0833
GBKEEª©¤j¯uªºÁÙ¬O­n§ä§A¨D±Ï~"~
¦Û¤v§ä¤F¤F«Ü¤[¡AÁÙ¬O¤£ª¾¹DQueryTable Äݩʪº¥Îªk
»Ý¥Î­þ¤@­ÓÄݩʳ]©w¤~¯à¤£¤U¸üºô­¶Àx¦s®æ®æ½u???
³Â·Ðª©¤j¤Î°ª¤âÀ°¦£¸Ñµª¡A·P¿E¤£ºÉ!!

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2017/7/29 09:18): 2010 ,2003 ¨ºµ{¦¡³£¤U¸ü³£¨S¦³®æ½u,©Ò¥H½Ð§A¤W¶ÇÀɮ׬ݬݨº¸Ì¥X¿ù


ª©¤jµ{¦¡½X¬O¥Î§Aªº
¹Ï¥ªÃä¬O¥[¤Jª©¤j«á¨Ó­×¥¿ªº
·Q§â®æ½u¤]¦P®É¨ú®ø
¤@ª½§ä¤£¨ì¤èªk¡A³Â·Ðª©¤jÀ°¦£¡AÁÂÁÂ

TOP

  1. Sub Ex1()
  2. Cells.Clear
  3.     Dim Ar(), a As Variant, i As Integer, stkno As String, Qur As String, DateVar As Integer, Sh As Worksheet
  4.     With CreateObject("InternetExplorer.Application")
  5.         .Navigate "http://www.tdcc.com.tw/smWeb/QryStock.jsp"
  6.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  7.         Set a = .Document.ALL.tags("option") '¸ê®Æ¤é´Áªº¤º®e
  8.         ReDim Ar(a.Length - 1)
  9.         For i = 0 To a.Length - 1
  10.             Ar(i) = a(i).innerHTML
  11.         Next
  12.         .Quit
  13.     End With
  14.     stkno = Sheets("¥Ø¼ÐªÑ²¼").Range("B2").Value    '
  15.     If stkno = "" Then Exit Sub
  16.     Set Sh = ActiveSheet             '«ü©w¤u§@ªí
  17.     With Sh
  18.         For DateVar = 0 To UBound(Ar)
  19.             Qur = "http://www.tdcc.com.tw/smWeb/QryStock.jsp?SCA_DATE=" & Ar(DateVar) & "&SqlMethod=StockNo&StockNo=" & stkno & "&StockName=&sub=%ACd%B8%DF"
  20.             .QueryTables.Add "URL;" & Qur, .Cells(1 + (DateVar * 32), "A")
  21.             '.Cells(1 + (DateVar * 32), "A")  AÄ涡¹j 32¦C
  22.             With .QueryTables(1)
  23.                 .WebSelectionType = xlSpecifiedTables
  24.                 .WebFormatting = xlWebFormattingNone
  25.                 .WebTables = "6,7,8"
  26.                 .WebPreFormattedTextToColumns = True
  27.                 .WebConsecutiveDelimitersAsOne = True
  28.                 .WebSingleBlockTextImport = False
  29.                 .WebDisableDateRecognition = False
  30.                 .WebDisableRedirections = False
  31.                 .PreserveFormatting = False
  32.                 .Refresh BackgroundQuery:=False
  33.                 Sh.Names(.Name).Delete '§R±¼¤u§@ªí¤Wªº¦WºÙ
  34.                 .Delete                '§R±¼³oQueryTable
  35.             End With
  36.         Next
  37.     End With
½Æ»s¥N½X
ª©¤j³o¬O§Ú¥Îªºµ{¦¡½X¡C

TOP

¦^´_ 23# chang0833

§Ú±N¤u§@ªí®æ½u§ï¦¨¬õ¦â,¨S¦³¤U¸ü¨ìºô­¶®æ¦¡ÃC¦â
§A¨S¤W¶ÇÀÉ®×,§Ú²ö®_¦Ï£«


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

TOP

ª©¤jÁÙ¬OÁÂÁ§A¡A§Ú«á¨Ó¥Î¤â°Êªº§â®æ½u®ø°£¤F
·Q»¡¥i¤£¥i¥H¥Ñ¹q¸£¶]µ{¦¡¡A¶¶«K¾Ç²ß¤@¤U¡A·P®¦^^

TOP

¦^´_ 9# GBKEE
GBKEE ¤j¤jªº Web ª©«Ü¦n¥Î¡A§Ú±`±`§Q¥Î³o­Óµ{¦¡¬d¸ß¡A¦ý«e´X¤Ñ¸Ó¬ÛÃöºô­¶¦ü¥G¦³­×§ï¹L¡A²{¦b¦pªG¶]µ{¦¡·|¥X²{¦p¤Uªº¿ù»~¡G
°õ¦æ¶¥¬q¿ù»~ '9':
°}¦C¯Á¤Þ¶W¥X½d³ò

°»¿ùªº¸Ü·|°±¦b²Ä9¦æªº
ReDim Ar(a.Length - 1)

¤£ª¾¦p¦ó¦]À³³o­Ó·s­×ªººô­¶¥h­×§ïµ{¦¡¡H
ÁÂÁ¡I

TOP

¦^´_ 26# oligo

«¢Åo¡A§Ú­è­è¤W¶Ç¤F¤@­Ó·sÀɮסA¥Î¨Ó§ì¨ú§ïª©«áªº¸ê®Æ¡A½Ð°Ñ¦Ò
    http://forum.twbts.com/thread-20646-1-1.html
§Æ±æ¦³À°¨ì±z~
Excel VBAºô­¶¸ê®Æ¦¬¶°±Ð¾Ç:
http://forum.twbts.com/thread-20848-1-1.html

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD