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

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

¦^´_ 17# GBKEE

ÁÂÁª©¤j¶}¸Ñ^^

TOP

¦^´_ 16# chang0833
  1. .PreserveFormatting = False   'µ{¦¡½X¤W¥[¤W³o¦æ
  2.                 .Refresh BackgroundQuery:=False
  3.                 Sh.Names(.Name).Delete '§R±¼¤u§@ªí¤Wªº¦WºÙ
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥i¥H½Ð¦U¦ì¥ý¶iÀ°¦£¸Ñµª³o°ÝÃD¶Ü¡H
1.¥»¨Ï¥ÎµÛ¶Wª©GBKEE©Ò´£¨Ñªºµ{¦¡¡A¦ý³Ìªñ
    ¦b¤U¸ü®É¡A«o³sºô­¶­I´ºÃC¦â³£¤U¸ü¤U¨Ó(­ì¥u¦³¤å¦r¨S­I´º)
    ¬O¤°»ò­ì¦]³y¦¨ªº¡H

TOP

Hi GBKEE ¤j¤j
§Ú§ä¤F¤@¥x¦³IE8ªº¹q¸£¡A±zªº­ì©lµ{¦¡¥i¥H°õ¦æ¡A­ì¨ÓIEª©¥»·|¦³³o¼Ëªº¼vÅT
ÁÂÁ«ü±Ð

TOP

¦^´_ 13# GBKEE
Hi GBKEE«e½ú
ÁÂÁ±z ¥i¥H¥Î!!!

TOP

¦^´_ 12# s13983037
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  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 = InputBox("¿é¤JªÑ²¼¥N¸¹", "ªÑ²¼¥N¸¹", 2313)    '
  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 * 27), "A")
  21.             '.Cells(1 + (DateVar * 27), "A")  AÄ涡¹j 27¦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.                 .Refresh BackgroundQuery:=False
  32.                 Sh.Names(.Name).Delete '§R±¼¤u§@ªí¤Wªº¦WºÙ
  33.                 .Delete                '§R±¼³oQueryTable
  34.             End With
  35.         Next
  36.     End With
  37. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 9# GBKEE

Hi GBKEE±z¦n
¬Ý¨ì±zªºµ{¦¡½X ·Q§â¥L­×¥¿¦¨ ­ÓªÑªº¶°«O¤é´Á
·í²Ä¤@µ§¤é´Á¿é¤J®É¶ñ¤J A1Ä椤
¦ý¬O²Ä¤Gµ§¸ê®Æ¿é¤J®É¶ñ¤JA28Ä椤
¥H¦¹Ãþ±À¨C¤@µ§¸ê®Æ¶ñ¤J«á³£»Ý¶¡¹j28Äæ¦ì,
¥Ø«e§Ú¥u¦³­×¥¿¨ì¥i¥H­«½Æ¶ñ¤J¤é´Áªº³¡¤À,½Ð±ÐGBKEE «e½ú ¤£ª¾­n¦p¦ó­×§ï,¥i§_´£ÂI°g¬z ·PÁ±z\QQ/

¥H¤U¬°­×¥¿µ{¦¡½X

    Dim Ar(), a, i As Integer, strDate As String, stkno As String, Qur As String
    With CreateObject("InternetExplorer.Application")
        .Navigate "http://www.tdcc.com.tw/smWeb/QryStock.jsp"
        Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
        Set a = .Document.ALL.tags("option") '¸ê®Æ¤é´Áªº¤º®e
        ReDim Ar(a.Length - 1)
        For i = 0 To a.Length - 1
            Ar(i) = a(i).innerHTML
        Next
        .Quit
    End With
   
    For DateVar = 0 To 28
    strDate = Ar(DateVar) '¾É¤J·í¤ë¤é´Á
    Do
        strDate = InputBox(Join(Ar, vbTab), "¶°«O¤áªÑÅv¤À´²ªí¬d¸ß ¤§ ¦³®Ä¤é´Á", strDate)
        If strDate = "" Then Exit Sub
     
    Loop Until IsNumeric(Application.Match(strDate, Ar, 0))
    stkno = InputBox("¿é¤JªÑ²¼¥N¸¹", "ªÑ²¼¥N¸¹", 2313)    '
    If stkno = "" Then Exit Sub
    Qur = "http://www.tdcc.com.tw/smWeb/QryStock.jsp?SCA_DATE=" & strDate & "&SqlMethod=StockNo&StockNo=" & stkno & "&StockName=&sub=%ACd%B8%DF"
    With ActiveSheet
                                For WriteDate = 1 To 1
                                        If .QueryTables.Count = 0 Then
                                                .QueryTables.Add "URL;" & Qur, .[A & WriteDate * 28 * (WriteDate) ]
                                        Else
                                                .QueryTables(1).Connection = "URL;" & Qur
                                        End If
                                        With .QueryTables(1)
                                                .WebSelectionType = xlSpecifiedTables
                                                .WebFormatting = xlWebFormattingNone
                                                .WebTables = "6,7,8"
                                                .WebPreFormattedTextToColumns = True
                                                .WebConsecutiveDelimitersAsOne = True
                                                .WebSingleBlockTextImport = False
                                                .WebDisableDateRecognition = False
                                                .WebDisableRedirections = False
                                                .Refresh BackgroundQuery:=False
                                        End With
                                Next
    End With
    Next

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-9-16 06:12 ½s¿è

¦^´_ 10# espionage
ºô­¶¤WªºªÑ²¼¥N¸¹¬d¸ß«á·|¤£·|®ø¥¢¤£¨£.ºÝ¬Ý¦Uºô­¶­ì©l½Xªº¼gªk.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

GBKEE ¤j¤j
1. ±z©Ò´£ªºWEB¬d¸ß¡A¥i¥H°õ¦æ
2. ¦Ü©ó­ì¥»»yªkªº­×§ïÁÙ¬O¤£¦æ­C¡A§Ú¦³°Ñ¦Ò¥t¥~¤@«Ê»yªk¡A¤]¬O±z¦^ÂЪº¡Ahttp://forum.twbts.com/viewthread.php?tid=9511¡A¨âªÌ¥Øªº«Ü¹³¡A¤@¼Ë¬O¿é¤J¥N¸¹»P¤é´Á¡A¶]¸ê®Æ¡Aµo²{³o­ÓVBA¬O¦³®Ä¡A¥i¥H¶]¥Xµ²ªG¡A©Ò¥H®¼¯Ç´eªº
3.  §Ú¦³µo²{¤@­Ó°ÝÃD¡A­ì¥»§Ú¸ß°Ýªººô­¶¡Ahttp://www.tdcc.com.tw/smWeb/QryStock.jsp¡A·í¿é¤J§¹ªÑ²¼¥N¸¹¡A¶]¥Xµ²ªG¤§«á¡Aºô­¶¤WªºªÑ²¼¥N¸¹´N·|®ø¥¢¤£¨£¤F¡A¦Óºô­¶­ì©lÀɪº¦æ¼Æ¥Ñ167¦æ¼W¥[¬°393¦æ¡A¦p¤U¹Ï¬õ®Ø¡A
4.  ¦Ó¥t¥~¤@½gºô­¶ http://mops.twse.com.tw/mops/web/t164sb04¡A·í¿é¤J§¹ªÑ²¼¥N¸¹¡A¶]¥Xµ²ªG¤§«á¡Aºô­¶¤WªºªÑ²¼¥N¸¹¤£·|®ø¥¢¡Aºô­¶­ì©lÀɪº¦æ¼Æ¥Ñ704¦æºû«ù¬°704¦æ¡A¦p¤U¹Ï¬õ®Ø¡A
5. ¤£ª¾¹D³o¦³¨S¦³Ãö«Y¡A¬G½Ð±Ð¤@¤U¡A§Ú¦b§äªB¤Í¦³IE8ªº¸Õ¸Õ¬Ý­ì¥»ªºcode
·PÁÂ

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-9-15 05:56 ½s¿è

¦^´_ 8# espionage
§Ú¥u¦³Ie8¨S³o°ÝÃD, Ie8 ¤¤element ªº Length =9
½Ð¦³¤ñIe8·sª©ªº·|­û,¬Ý¬Ý°ÝÃD¦b­þ¸Ì.
  1. Application.VBE.Windows("°Ï°ìÅܼÆ").Visible = True '½Ð¦A¥[¤W
  2.     Stop  'µ{¦¡°±¤U¨Ó
  3.     '¦p7#ªº¹Ï¥i¥H¬Ý¬Ý§Aªº "°Ï°ìÅܼÆ"µøµ¡ ¤¤  element ªº Length ¬O¦h¤Ö
½Æ»s¥N½X
©Î¬O
  1. Application.Wait #12:00:05 AM#    '¦bµ{¦¡¤¤'µ¥­Ô5¬í
  2.         Set element = .Document.getelementsbytagname("table")  '¨ú±oºô­¶¸ê®Æ°Ï¶ô
  3.         Stop  'µ{¦¡°±¤U¨Ó,¬Ý "°Ï°ìÅܼÆ"µøµ¡ ¤¤  element ªº Length ¬O¦h¤Ö
  4.         With Sheets(1)
  5.             .Cells.Clear
  6.         
½Æ»s¥N½X
©Î¬O¥ÎWEB¬d¸ß
  1. Sub Ex() '¶°«O¤áªÑÅv¤À´²ªí_WEB¬d¸ß
  2.     Dim Ar(), a, i As Integer, strDate As String, stkno As String, Qur As String
  3.     With CreateObject("InternetExplorer.Application")
  4.         .Navigate "http://www.tdcc.com.tw/smWeb/QryStock.jsp"
  5.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  6.         Set a = .Document.ALL.tags("option") '¸ê®Æ¤é´Áªº¤º®e
  7.         ReDim Ar(a.Length - 1)
  8.         For i = 0 To a.Length - 1
  9.             Ar(i) = a(i).innerHTML
  10.         Next
  11.         .Quit
  12.     End With
  13.     strDate = Ar(0) '¾É¤J·í¤ë¤é´Á
  14.     Do
  15.         strDate = InputBox(Join(Ar, vbTab), "¶°«O¤áªÑÅv¤À´²ªí¬d¸ß ¤§ ¦³®Ä¤é´Á", strDate)
  16.         If strDate = "" Then Exit Sub
  17.      
  18.     Loop Until IsNumeric(Application.Match(strDate, Ar, 0))
  19.     stkno = InputBox("¿é¤JªÑ²¼¥N¸¹", "ªÑ²¼¥N¸¹", 2317)    '
  20.     If stkno = "" Then Exit Sub
  21.     Qur = "http://www.tdcc.com.tw/smWeb/QryStock.jsp?SCA_DATE=" & strDate & "&SqlMethod=StockNo&StockNo=" & stkno & "&StockName=&sub=%ACd%B8%DF"
  22.     With ActiveSheet
  23.         If .QueryTables.Count = 0 Then
  24.             .QueryTables.Add "URL;" & Qur, .[A1]
  25.         Else
  26.             .QueryTables(1).Connection = "URL;" & Qur
  27.         End If
  28.         With .QueryTables(1)
  29.             .WebSelectionType = xlSpecifiedTables
  30.             .WebFormatting = xlWebFormattingNone
  31.             .WebTables = "6,7,8"
  32.             .WebPreFormattedTextToColumns = True
  33.             .WebConsecutiveDelimitersAsOne = True
  34.             .WebSingleBlockTextImport = False
  35.             .WebDisableDateRecognition = False
  36.             .WebDisableRedirections = False
  37.             .Refresh BackgroundQuery:=False
  38.         End With
  39.     End With
  40. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD