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

[µo°Ý] ½Ð±Ð ¤j¤j ³oµ{¦¡¬O¨º­Ó¦a¤è¥X²{°ÝÃD¡AÁÂÁÂ

[µo°Ý] ½Ð±Ð ¤j¤j ³oµ{¦¡¬O¨º­Ó¦a¤è¥X²{°ÝÃD¡AÁÂÁÂ

[attach]29643[/attach]
½Ð±Ð ¤j¤j ³oµ{¦¡¬O¨º­Ó¦a¤è¥X²{°ÝÃD¡AÁÂÁÂ
¤u§@ªí3´N¥u½Æ»s¤u§@ªí2ªººô
  1. Option Explicit
  2. Dim ie As Object   '¼Ò²Õ³Ì³»ºÝ Dim ¨Ñ³o¼Ò²Õªºµ{§Ç¨Ï¥ÎªºÅܼÆ
  3. Sub AllFile()
  4.     Dim i As Integer, v, Y As Integer, S As String
  5.     Set ie = CreateObject("internetexplorer.application")   '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
  6.     With ie 'ÁY¤pIEµøµ¡
  7.         .Visible = True
  8.         .Width = 5
  9.         .Height = 5
  10.     End With

  11.     With ¤u§@ªí1
  12.       Dim AR
  13.         AR = .Range("E1:M1")
  14.         .Range("E:M") = ""
  15.         .Range("E1:M1") = AR

  16. '        .Range("E2").CurrentRegion = ""            '²M°£¤u§@ªí1,¦~«×½d³ò
  17.     v = "2330"
  18.           GetDividend (v)
  19.            GetClosePrice (v)
  20.            GetIncome (v)
  21.            GetBalance (v)
  22.            GetShareholding (v)

  23.             Debug.Print v

  24. End With
  25.     With ie  'IEµøµ¡³Ì¤j¤Æ
  26.         Application.WindowState = xlMaximized
  27.         .Height = Application.Height
  28.         .Width = Application.Width
  29.         .Quit
  30.     End With
  31. End Sub

  32. Private Sub GetDividend(ByVal ss As String)     '¨úªÑ§Qºô­¶

  33.     Dim rr As String, T As Date, i, ii, k, j, S As Object
  34.     'On Error Resume Next 'µ{¦¡ªº°õ¦æ¨S¦³¹w´Áªº¿ù»~,¦¹¦æ¥i¤£¥Î.
  35.     T = Time
  36.     rr = "http://pscnetinvest.moneydj.com.tw/z/zc/zcc/zcc_" & ss & ".djhtm"
  37.     With ie
  38.         .Navigate rr
  39.         Do While .readyState <> 4                          'µ¥«Ýºô­¶¤U¸ü§¹²¦
  40.               DoEvents
  41.               If Time >= T + #12:00:03 AM# Then
  42.                 DoEvents
  43.                 Application.SendKeys "~"                    'ªÑ²¼¥N¸¹¿ù»~,ºô­¶·|¦³°T®§,¶·«ö½T©w,¤~¥iÄ~Äò¤U­±ªÑ²¼¥N¸¹
  44.                
  45.                
  46.                 Exit Do
  47.               End If
  48.         Loop
  49.         Do
  50.         Set S = .Document.getElementsByTagName("table")(2) ' ·sªº table 4
  51.         Loop Until Not S Is Nothing

  52.         With ¤u§@ªí2
  53.             .UsedRange.Clear
  54.             For i = 0 To S.Rows.Length - 1      '¼g¤J¸ê®Æ
  55.                 k = k + 1
  56.                     For ii = 0 To S.Rows(i).Cells.Length - 1  ' S.Rows(i).Cells.Length - 1 ¤~¬O¥¿½T
  57.                     .Cells(k, ii + 1) = S.Rows(i).Cells(ii).innerText
  58.                     DoEvents
  59.                     Next
  60.             Next
  61.         End With
  62.     End With
  63. End Sub

  64. Private Sub GetClosePrice(ByVal ss As String) ' ¨ú°ò¥»¸ê®Æ

  65.     Dim rr As String, T As Date, i, ii, k, j, S As Object
  66.     'On Error Resume Next 'µ{¦¡ªº°õ¦æ¨S¦³¹w´Áªº¿ù»~,¦¹¦æ¥i¤£¥Î.
  67.     T = Time
  68.     'rr = "http://dj.mybank.com.tw/z/zc/zca/zca_" & ss & ".asp.htm" '¨ú(°ò¥»¸ê®Æ) ¦¬½L»ù ¥»¯q¤ñ ­t¶Å¤ñ ºô­¶
  69.     rr = "http://pscnetinvest.moneydj.com.tw/z/zc/zca/zca_" & ss & ".djhtm"
  70.     With ie
  71.         .Navigate rr
  72.         Do While .readyState <> 4                          'µ¥«Ýºô­¶¤U¸ü§¹²¦
  73.               DoEvents
  74.               If Time >= T + #12:00:03 AM# Then
  75.                 DoEvents
  76.                 Application.SendKeys "~"                    'ªÑ²¼¥N¸¹¿ù»~,ºô­¶·|¦³°T®§,¶·«ö½T©w,¤~¥iÄ~Äò¤U­±ªÑ²¼¥N¸¹

  77.                 Exit Do
  78.               End If
  79.         Loop
  80.         Do
  81.         Set S = .Document.getElementsByTagName("table")(2) ' ·sªº table 4
  82.         Loop Until Not S Is Nothing

  83.         With ¤u§@ªí3
  84.             .UsedRange.Clear
  85.             For i = 0 To S.Rows.Length - 1      '¼g¤J¸ê®Æ
  86.                 k = k + 1
  87.                     For ii = 0 To S.Rows(i).Cells.Length - 1  ' S.Rows(i).Cells.Length - 1 ¤~¬O¥¿½T
  88.                     .Cells(k, ii + 1) = S.Rows(i).Cells(ii).innerText
  89.                     DoEvents
  90.                     Next
  91.             Next
  92.         End With
  93.     End With
  94. End Sub


  95. Private Sub GetIncome(ByVal ss As String)     '¨ú·l¯qªí(¦~ªí)ºô­¶

  96.     Dim rr As String, T As Date, i, ii, k, j, S As Object
  97.     T = Time
  98.     'rr = "http://yamstock.megatime.com.tw/asp/stockinfo/GetReport.asp?Select_Table=html\YFinain\&StockID=" & ss     '¨ú·l¯qªí(¦~ªí)ºô­¶
  99.    
  100.    
  101.     rr = "http://pscnetinvest.moneydj.com.tw/z/zc/zcq/zcqa_" & ss & ".djhtm"

  102.     With ie
  103.         .Navigate rr
  104.         Do While .readyState <> 4                          'µ¥«Ýºô­¶¤U¸ü§¹²¦
  105.               DoEvents
  106.               If Time >= T + #12:00:03 AM# Then
  107.                 DoEvents
  108.                 Application.SendKeys "~"                    'ªÑ²¼¥N¸¹¿ù»~,ºô­¶·|¦³°T®§,¶·«ö½T©w,¤~¥iÄ~Äò¤U­±ªÑ²¼¥N¸¹
  109.                
  110.                 Exit Do
  111.               End If
  112.         Loop
  113.         Do
  114.         Set S = .Document.getElementsByTagName("table")(2) ' ·sªº table 4
  115.         Loop Until Not S Is Nothing

  116.         With ¤u§@ªí4
  117.             .UsedRange.Clear
  118.             For i = 0 To S.Rows.Length - 1      '¼g¤J¸ê®Æ
  119.                 k = k + 1
  120.                 'For j = 0 To S.Rows(i).Length - 1  '³o¦æ¬O¿ù»~ªº ¤]¬O¦h¾lªº°j°é
  121.                    '¥Î On Error Resume Next ¨Ïµ{¦¡Ä~Äò°õ¦æ
  122.                     For ii = 0 To S.Rows(i).Cells.Length - 1  ' S.Rows(i).Cells.Length - 1 ¤~¬O¥¿½T
  123.                     .Cells(k, ii + 1) = S.Rows(i).Cells(ii).innerText
  124.                     DoEvents
  125.                     Next
  126.                 'Next
  127.             Next
  128.         End With
  129.     End With
  130. End Sub

  131. Private Sub GetBalance(ByVal ss As String)     '¨ú¸ê²£­t¶Åªí(¦~ªí)ºô­¶

  132.     Dim rr As String, T As Date, i, ii, k, j, S As Object
  133.     'On Error Resume Next 'µ{¦¡ªº°õ¦æ¨S¦³¹w´Áªº¿ù»~,¦¹¦æ¥i¤£¥Î.
  134.     T = Time
  135.    
  136.     rr = "http://pscnetinvest.moneydj.com.tw/z/zc/zcp/zcpb/zcpb_" & ss & ".djhtm"
  137.     With ie
  138.         .Navigate rr
  139.         Do While .readyState <> 4                          'µ¥«Ýºô­¶¤U¸ü§¹²¦
  140.               DoEvents
  141.               If Time >= T + #12:00:03 AM# Then
  142.                 DoEvents
  143.                 Application.SendKeys "~"                    'ªÑ²¼¥N¸¹¿ù»~,ºô­¶·|¦³°T®§,¶·«ö½T©w,¤~¥iÄ~Äò¤U­±ªÑ²¼¥N¸¹
  144.                
  145.                 Exit Do
  146.               End If
  147.         Loop
  148.         Do
  149.         Set S = .Document.getElementsByTagName("table")(2) ' ·sªº table 4
  150.         Loop Until Not S Is Nothing


  151.         With ¤u§@ªí5
  152.             .UsedRange.Clear
  153.             For i = 0 To S.Rows.Length - 1      '¼g¤J¸ê®Æ
  154.                 k = k + 1
  155.                     For ii = 0 To S.Rows(i).Cells.Length - 1  ' S.Rows(i).Cells.Length - 1 ¤~¬O¥¿½T
  156.                     .Cells(k, ii + 1) = S.Rows(i).Cells(ii).innerText
  157.                     DoEvents
  158.                     Next
  159.             Next
  160.         End With
  161.     End With
  162. End Sub
  163. Private Sub GetShareholding(ByVal ss As String)     '¨ú¸³ºÊ«ùªÑºô­¶

  164.     Dim rr As String, T As Date, i, ii, k, j, S As Object
  165.     'On Error Resume Next 'µ{¦¡ªº°õ¦æ¨S¦³¹w´Áªº¿ù»~,¦¹¦æ¥i¤£¥Î.
  166.     T = Time
  167.     rr = "http://pscnetinvest.moneydj.com.tw/z/zc/zcj/zcj_" & ss & ".djhtm"     '¨ú¸³ºÊ«ùªÑºô­¶
  168.     With ie
  169.         .Navigate rr
  170.         Do While .readyState <> 4                          'µ¥«Ýºô­¶¤U¸ü§¹²¦
  171.               DoEvents
  172.               If Time >= T + #12:00:03 AM# Then
  173.                 DoEvents
  174.                 Application.SendKeys "~"                    'ªÑ²¼¥N¸¹¿ù»~,ºô­¶·|¦³°T®§,¶·«ö½T©w,¤~¥iÄ~Äò¤U­±ªÑ²¼¥N¸¹
  175.                
  176.                 Exit Do
  177.               End If
  178.         Loop
  179.         Do
  180.         Set S = .Document.getElementsByTagName("table")(3) ' ·sªº table 4
  181.         Loop Until Not S Is Nothing

  182.         With ¤u§@ªí6
  183.             .UsedRange.Clear
  184.             For i = 0 To S.Rows.Length - 1      '¼g¤J¸ê®Æ
  185.                 k = k + 1
  186.                     For ii = 0 To S.Rows(i).Cells.Length - 1  ' S.Rows(i).Cells.Length - 1 ¤~¬O¥¿½T
  187.                     .Cells(k, ii + 1) = S.Rows(i).Cells(ii).innerText
  188.                     DoEvents
  189.                     Next
  190.             Next
  191.         End With
  192.     End With
  193. End Sub
½Æ»s¥N½X

´ú¸ÕÀÉ.rar (17.16 KB)

¦^´_ 1# wufonna


    ¬ã¨s¤F¤@¤U¡A
¥»¨Ó·Q·Ó§Úªº¤è¦¡­«¼g¡A
¬Ý¤Fı±o¦³ÂI³Â·Ð...(¤£¦n·N«ä)
©Ò¥Hª½±µ§ï§Aªºª©¥»¡C

¦pªG¨S²q¿ùªº¸Ü¬O§Aªº¨p¥Îµ{§Ç¨S¦³¸ò¤Wºô­¶¸ê®Æ¡A
©Ò¥H¦³¤£¦P¨Bªº¦a¤è¤~¾É­P"¨S¦³Åv­­" ".Navigateµøµ¡¥¢±Ñ"...µ¥ª¬ªp
§Ú§â§A¨C­Óµ{§Ç³£§ï¦¨·s¶}±Òºô­¶(¬°¤F§äª¼ÂI)¡A
µM«á¤w¸g³sÄò°õ¦æ10¦¸³£¨S¦³¸õ¥X¿ù»~°T®§¡C
°O±o¥H«e§Ú¤]¸I¹LÃþ¦ü°ÝÃD(«ç»ò­×¥¿ªº¤]§Ñ¤F)¡A
¤j·§­×¤@­×½s¼gÅÞ¿è´N¦n¤F¡C
§A¦b¦Û¤v¬Ý¤@¤U¡C

¥t¥~§Ú§â§Aºô­¶³Ì¤p¤Æ§ï¦¨­I´º°õ¦æWeb¡C
(½T«Oµ{§Ç¨S¿ù¦bFalse¡A´ú¸Õ¤¤½ÐTrue¡A§_«h¤¤Â_µ{¦¡«á±q¤u§@ºÞ²z­û¤â°ÊÃö³¬­I´º´Ý¯dIE)

´ú¸ÕÀÉ.rar (20.55 KB)

¤@¤À§V¤O¡A¤@¤À¦¬Ã¬¡C
µo°ÝÃD«e¥i¥H¥ý·j¯Á¤º¤å¬O§_¦³¬ÛÃö½d¨Ò¡C

TOP

¥»©«³Ì«á¥Ñ wufonna ©ó 2018-11-6 12:55 ½s¿è

¦^´_ 2# faye59

ÁÂÁ faye ¤j¡AÁÙ¬O·|¥X¿ù¡A´N¬O¤j¤j»¡ªº Navigate¿ù¡A¥»¨Ó¦bª©ªº¢×¢Ó¤W¥i°õ¦æ¡A¤É¯ÅIE«á´N·|¿ù»~¡C
³o¬O­ìµ{¦¡¡A³Â·Ð ¤j¤j ¬Ý¬Ý¡C
Â^¨ú.JPG

´ú¸ÕÀÉ2.rar (163.44 KB)

TOP

¦^´_ 3# wufonna


À³¸Ó¬O¤@¼Ëªº°ÝÃD...
  1. Set ie = CreateObject("internetexplorer.application")
½Æ»s¥N½X
¨C­ÓPrivateµ{§Ç³£¥[¤J§a~

¥t¥~§AªºAlert°T®§­×§ï¤@¤U·|§ó¦n¡A
§Ú·|¥Î³o­Ó¥h±±¨î°T®§¦¡µ¡:
  1. Set wshshell = CreateObject("wscript.shell")
  2. Do
  3.     ret = wshshell.AppActivate("ºô­¶°T®§")
  4. Loop Until ret = True
  5. Application.Wait Now + 2 / 86400
  6. ret = wshshell.AppActivate("ºô­¶°T®§")
  7.     If ret = True Then
  8.         ret = wshshell.AppActivate("ºô­¶°T®§")'"ºô­¶°T®§"³o¤å¦r»Ý­n§ï¦¨§Aĵ§iµøµ¡ªºTitle
  9.         Application.Wait Now + 2 / 86400
  10.         wshshell.SendKeys "{enter}"
  11.     End If
  12. Application.Wait Now + 2 / 86400
  13. Do While .readystate <> 4 Or .busy: DoEvents: Loop
½Æ»s¥N½X
§Ú°O±o³o¬O³Â»¶®a²Õ¬Y¦ì¥ý¶i´£¨Ñªº¤è¦¡¡A
¥­±`¥Î¤£¨ì¡A
¦ý»Ý­n¥Î¤W®É¯uªº«Ü¦n¥Î¡A
³o¬qµ{¦¡½X¬O¥ý°»´úĵ§i°T®§¦A§âĵ§i°T®§¸m³»¡A
³o¼Ë¦bSendKeys "{enter}"¯à½T«O¥¿½T«ö¤U¡C
¤@¤À§V¤O¡A¤@¤À¦¬Ã¬¡C
µo°ÝÃD«e¥i¥H¥ý·j¯Á¤º¤å¬O§_¦³¬ÛÃö½d¨Ò¡C

TOP

¦^´_ 4# faye59

ÁÂÁÂ ¤j¤j
¤j¤j ³oµ{¦¡¬O©¿²¤¿ùªº¶Ü?
§Ú§ï¦^ie8¤F
´ú¸Õ¥i¯à¬O table ªºÀY¥]¦bform¤º¤£¯à°õ¦æ   
http://pscnetinvest.moneydj.com.tw/z/zc/zcq/zcqa_2330.djhtm
³oºô­¶¨S¥]¦b¤º´N¥i¥H
http://pscnetinvest.moneydj.com.tw/z/zc/zcq/zcqa0_2330.djhtm

¥Îª©¥D¤j http://forum.twbts.com/thread-12273-1-1.html
ªº´ú¸Õ¥i¥H¡A½Ð±Ð¥i¥Î div °Ï¶ô¶Ü¡A¦]div ¨S¥]¦bform¤º¡AÁÙ¬O¬O¦]§Oªº­ì¦]¡AÁÂÁÂ

TOP

¦^´_ 5# wufonna


    ¤£¬O©¿²¤¿ù»~®@!!
¦Ó¬O§âAlert°T®§¿ï¾Ü¡A
ÅýENTER¤£·|«ö¿ù¦a¤è¡C
¤@¤À§V¤O¡A¤@¤À¦¬Ã¬¡C
µo°ÝÃD«e¥i¥H¥ý·j¯Á¤º¤å¬O§_¦³¬ÛÃö½d¨Ò¡C

TOP

©ñ±ó¤FÁÙ¬O§ä¤£¨ì­ì¦]¡A¥Î GBKEE ¶Wª©¤j¤j msxml2.xmlhttp ªº¤èªk¥i¥H¥Î¤F¡AÁÂÁÂ
http://forum.twbts.com/thread-21270-1-2.html
  1. Option Explicit

  2. Dim ie As Object   '¼Ò²Õ³Ì³»ºÝ Dim ¨Ñ³o¼Ò²Õªºµ{§Ç¨Ï¥ÎªºÅܼÆ
  3. Sub AllFile()
  4.     Dim i As Integer, v, Y As Integer, S As String
  5.     Set ie = CreateObject("internetexplorer.application")   '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
  6.     With ie 'ÁY¤pIEµøµ¡
  7.         .Visible = True
  8.         .Width = 5
  9.         .Height = 5
  10.     End With

  11.     With ¤u§@ªí1
  12.       Dim AR
  13.         AR = .Range("E1:M1")
  14.         .Range("E:M") = ""
  15.         .Range("E1:M1") = AR

  16. '        .Range("E2").CurrentRegion = ""            '²M°£¤u§@ªí1,¦~«×½d³ò
  17.         For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
  18.             v = .Cells(i, 1).Value
  19. '''''
  20.           GetDividend (v)
  21.            GetClosePrice (v)
  22.            GetIncome (v)
  23.            GetBalance (v)
  24.            GetShareholding (v)

  25.           .Cells(i, 5).Value = ¤u§@ªí2.Cells(5, 2).Value
  26.           .Cells(i, 6).Value = ¤u§@ªí2.Cells(5, 3).Value
  27.           .Cells(i, 7).Value = ¤u§@ªí3.Cells(2, 8).Value
  28.           .Cells(i, 8).Value = .Cells(i, 5).Value / .Cells(i, 7).Value   '²{ª÷´Þ§Q²v
  29.             On Error Resume Next
  30. '          .Cells(i, 8).NumberFormatLocal = "0.00%"
  31.           .Cells(i, 9).Value = ¤u§@ªí4.Cells(66, 2).Value / ¤u§@ªí5.Cells(94, 2).Value 'ROE%
  32.             On Error Resume Next
  33.           .Cells(i, 10).Value = ¤u§@ªí3.Cells(4, 2).Value '¥»¯q¤ñ
  34.           .Cells(i, 11).Value = ¤u§@ªí3.Cells(12, 4).Value 'ªÑ»ù²b­È¤ñ
  35.           .Cells(i, 12).Value = ¤u§@ªí3.Cells(11, 4).Value '­t¶Å¤ñ%
  36. '          .Cells(i, 12).NumberFormatLocal = "0.00%"
  37.           .Cells(i, 13).Value = ¤u§@ªí6.Cells(3, 4).Value '¸³ºÊ«ùªÑ%
  38. '          .Cells(i, 13).NumberFormatLocal = "0.00%"


  39.             Debug.Print v
  40.         Next
  41.     End With
  42.     With ie  'IEµøµ¡³Ì¤j¤Æ
  43.         Application.WindowState = xlMaximized
  44.         .Height = Application.Height
  45.         .Width = Application.Width
  46.         .Quit
  47.     End With
  48. End Sub

  49. Public Function MyFile(v As Integer, i As Integer)
  50.   '   Dim i As Integer, v, Y As Integer, S As String
  51.     Set ie = CreateObject("internetexplorer.application")   '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
  52.     With ie 'ÁY¤pIEµøµ¡
  53.         .Visible = True
  54.         .Width = 5
  55.         .Height = 5
  56.     End With
  57.     With ¤u§@ªí1
  58.            .Range("E" & v & ":M" & v) = ""
  59. '        .Range("E2").CurrentRegion = ""            '²M°£¤u§@ªí1,¦~«×½d³ò
  60.             v = .Cells(i, 1).Value

  61.            GetDividend (v)
  62.            GetClosePrice (v)
  63.            GetIncome (v)
  64.            GetBalance (v)
  65.            GetShareholding (v)

  66.           .Cells(i, 5).Value = ¤u§@ªí2.Cells(5, 2).Value
  67.           .Cells(i, 6).Value = ¤u§@ªí2.Cells(5, 3).Value
  68.           .Cells(i, 7).Value = ¤u§@ªí3.Cells(2, 8).Value
  69.           .Cells(i, 8).Value = .Cells(i, 5).Value / .Cells(i, 7).Value   '²{ª÷´Þ§Q²v
  70.             On Error Resume Next
  71. '          .Cells(i, 8).NumberFormatLocal = "0.00%"
  72.           .Cells(i, 9).Value = ¤u§@ªí4.Cells(66, 2).Value / ¤u§@ªí5.Cells(94, 2).Value 'ROE%
  73.             On Error Resume Next
  74.           .Cells(i, 10).Value = ¤u§@ªí3.Cells(4, 2).Value '¥»¯q¤ñ
  75.           .Cells(i, 11).Value = ¤u§@ªí3.Cells(12, 4).Value 'ªÑ»ù²b­È¤ñ
  76.           .Cells(i, 12).Value = ¤u§@ªí3.Cells(11, 4).Value '­t¶Å¤ñ%
  77. '          .Cells(i, 12).NumberFormatLocal = "0.00%"
  78.           .Cells(i, 13).Value = ¤u§@ªí6.Cells(3, 4).Value '¸³ºÊ«ùªÑ%
  79. '          .Cells(i, 13).NumberFormatLocal = "0.00%"


  80.     End With

  81.     With ie  'IEµøµ¡³Ì¤j¤Æ
  82.         Application.WindowState = xlMaximized
  83.         .Height = Application.Height
  84.         .Width = Application.Width
  85.         .Quit
  86.     End With
  87. End Function

  88. Private Sub GetDividend(ByVal ss As String)     '¨úªÑ§Qºô­¶
  89.   Dim strText As String
  90.   Dim i As Integer, j As Integer, xTable As Object
  91.   With CreateObject("msxml2.xmlhttp")
  92.     .Open "GET", "http://pscnetinvest.moneydj.com.tw/z/zc/zcc/zcc_" & ss & ".djhtm", False
  93.     .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  94.     .send
  95.     strText = BinToStr(.responseBody, "BIG5") '­nª`·Nºô­¶½s½X
  96.   End With
  97.   With CreateObject("htmlfile")
  98.         .Write strText
  99.         Set xTable = .all.tags("table")(2)
  100.         With ¤u§@ªí2
  101.             .Cells.Clear
  102.             For i = 0 To xTable.Rows.Length - 1
  103.                 For j = 0 To xTable.Rows(i).Cells.Length - 1
  104.                     .Cells(i + 1, j + 1) = xTable.Rows(i).Cells(j).innertext
  105.                 Next
  106.             Next
  107.         End With
  108.   End With
  109. End Sub

  110. Private Sub GetClosePrice(ByVal ss As String) ' ¨ú°ò¥»¸ê®Æ
  111.   Dim strText As String
  112.   Dim i As Integer, j As Integer, xTable As Object
  113.   With CreateObject("msxml2.xmlhttp")
  114.     .Open "GET", "http://pscnetinvest.moneydj.com.tw/z/zc/zca/zca_" & ss & ".djhtm", False
  115.     .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  116.     .send
  117.     strText = BinToStr(.responseBody, "BIG5") '­nª`·Nºô­¶½s½X
  118.   End With
  119.   With CreateObject("htmlfile")
  120.         .Write strText
  121.         Set xTable = .all.tags("table")(2)
  122.         With ¤u§@ªí3
  123.             .Cells.Clear
  124.             For i = 0 To xTable.Rows.Length - 1
  125.                 For j = 0 To xTable.Rows(i).Cells.Length - 1
  126.                     .Cells(i + 1, j + 1) = xTable.Rows(i).Cells(j).innertext
  127.                 Next
  128.             Next
  129.         End With
  130.   End With
  131. End Sub


  132. Private Sub GetIncome(ByVal ss As String)     '¨ú·l¯qªí(¦~ªí)ºô­¶
  133.   Dim strText As String
  134.   Dim i As Integer, j As Integer, xTable As Object
  135.   With CreateObject("msxml2.xmlhttp")
  136.     .Open "GET", "http://kgieworld.moneydj.com/z/zc/zcq/zcqa/zcqa_" & ss & ".djhtm", False
  137.     .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  138.     .send
  139.     strText = BinToStr(.responseBody, "BIG5") '­nª`·Nºô­¶½s½X
  140.   End With
  141.   With CreateObject("htmlfile")
  142.         .Write strText
  143.         Set xTable = .all.tags("table")(2)
  144.         With ¤u§@ªí4
  145.             .Cells.Clear
  146.             For i = 0 To xTable.Rows.Length - 1
  147.                 For j = 0 To xTable.Rows(i).Cells.Length - 1
  148.                     .Cells(i + 1, j + 1) = xTable.Rows(i).Cells(j).innertext
  149.                 Next
  150.             Next
  151.         End With
  152.   End With
  153. End Sub

  154. Private Sub GetBalance(ByVal ss As String)     '¨ú¸ê²£­t¶Åªí(¦~ªí)ºô­¶
  155.   Dim strText As String
  156.   Dim i As Integer, j As Integer, xTable As Object
  157.   With CreateObject("msxml2.xmlhttp")
  158.     .Open "GET", "http://kgieworld.moneydj.com/z/zc/zcp/zcpb/zcpb_" & ss & ".djhtm", False
  159.     .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  160.     .send
  161.     strText = BinToStr(.responseBody, "BIG5") '­nª`·Nºô­¶½s½X
  162.   End With
  163.   With CreateObject("htmlfile")
  164.         .Write strText
  165.         Set xTable = .all.tags("table")(2)
  166.         With ¤u§@ªí5
  167.             .Cells.Clear
  168.             For i = 0 To xTable.Rows.Length - 1
  169.                 For j = 0 To xTable.Rows(i).Cells.Length - 1
  170.                     .Cells(i + 1, j + 1) = xTable.Rows(i).Cells(j).innertext
  171.                 Next
  172.             Next
  173.         End With
  174.   End With
  175. End Sub
  176. Private Sub GetShareholding(ByVal ss As String)     '¨ú¸³ºÊ«ùªÑºô­¶
  177.   Dim strText As String
  178.   Dim i As Integer, j As Integer, xTable As Object
  179.   With CreateObject("msxml2.xmlhttp")
  180.     .Open "GET", "http://pscnetinvest.moneydj.com.tw/z/zc/zcj/zcj_" & ss & ".djhtm", False
  181.     .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  182.     .send
  183.     strText = BinToStr(.responseBody, "BIG5") '­nª`·Nºô­¶½s½X
  184.   End With
  185.   With CreateObject("htmlfile")
  186.         .Write strText
  187.         Set xTable = .all.tags("table")(3)
  188.         With ¤u§@ªí6
  189.             .Cells.Clear
  190.             For i = 0 To xTable.Rows.Length - 1
  191.                 For j = 0 To xTable.Rows(i).Cells.Length - 1
  192.                     .Cells(i + 1, j + 1) = xTable.Rows(i).Cells(j).innertext
  193.                 Next
  194.             Next
  195.         End With
  196.   End With
  197. End Sub
  198. Function BinToStr(arrBin, strChrs)
  199.     With CreateObject("ADODB.Stream")
  200.         .Type = 2
  201.         .Open
  202.         .Writetext arrBin
  203.         .Position = 0
  204.         .Charset = strChrs
  205.         BinToStr = .ReadText
  206.         .Close
  207.     End With
  208. End Function
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD