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

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

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

¦U¦ì°ª¤â§A­Ì¦n ¤p§Ì¦bª¦§¹«Ü¦h­¶­±
¤]google ¬Ý¤F´X­Ó°ª¤âªº»yªk¡A·Q­n¹Á¸Õ¥Î VBA ¥h ¶°«O¤áªÑÅv¤À´²ªí¬d¸ß ¡A¿é¤J¤@­Ó¥N¸¹¡A§ì¨C¶gªºªÑ²¼ªÑÅv¤À´²ªí¸ê®Ætable¡A§ì¨ìExcel¥h¤ÀªR
ºô§}¡Ghttp://www.tdcc.com.tw/smWeb/QryStock.jsp

¦ý¥u·|¼g¨ì«ç»ò§âªÑ²¼¥N¸¹¿é¤J¡A¦ý¬O¤é´Áªº¿ï³æ¹ê¦b¤£ª¾­n«ç»ò¾Þ§@¡Aºô­¶ "¸ê®Æ¤é´Á" select §ä¤£¨ì  .value¡A´N°±¦b³oÃä·Q¦n´X¤Ñ¡AÁÙ¬O¤£ª¾«ç»ò¼g¤U¥h¤F
Áٽаª¤â«ü±Ð»yªk
·P®¦

==========================================
Sub ¶°«O§ì¨ú()

Dim A
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://www.tdcc.com.tw/smWeb/QryStock.jsp"
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop

With .document
'-----¿é¤J­n¬d¸ßªºªÑ²¼¥N½X
   For Each A In .getelementsbytagname("INPUT") '§ä­ì©l½X¦³input°Ñ¼Æ
   If A.Name = "StockNo" Then A.Value = Range("B1").Value '§ä­ì©l½X¦³input°Ñ¼Æ
   Next
   
End With

End With
End Sub
==========================================

¦^´_ 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

¦^´_ 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

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

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

  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

[ª©¥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

¦^´_ 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

¤£¦n·N«ä¡A°ÝÃD¦h¤FÂI
·Ð½ÐGBKEE¤j¤j´£ÂI!!
§Ú¦¹¦¸¤U¦¸¤U¸ü¤U¨Ó¡A³s±aªº³s¾ã­Óºô­¶ªí®æªº®æ¦¡³£¤@°_¤U¸ü¤U¨Ó
¦p¦ó¤~¯à¥u¤U¸ü¯Â¸ê®Æ´N¦n¡A¤£­n¦³¥ô¦óºô­¶ªí®æ®æ¦¡¡H

TOP

¦^´_ 18# chang0833

¦b«_¬N½Ð¶Wª©GBKEE
¤U¸ü·|¥X²{³o®æ¦¡ªºÅÜ°Ê¡A¬O¦]¬°ºô¯¸ªººô­¶µ{¦¡¥»¨­Åܰʳy¦¨ªº¶Ü¡H

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦pÆp¥Û¡j®É¶¡¹ï¤@­Ó¦³´¼¼zªº¤H¦Ó¨¥¡A´N¦pÆp¥Û¯ë¬Ã¶Q¡F¦ý¹ï·M¤H¨Ó»¡¡A«o¹³¬O¤@§âªd¤g¡A¤@ÂI»ù­È¤]¨S¦³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD