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

[µo°Ý] ¨Ï¥Î¤¸¤jÃÒYeswinªºRTD¤¸¥ó§Y®É§ó·sªÑ»ù°ÝÃD??

[µo°Ý] ¨Ï¥Î¤¸¤jÃÒYeswinªºRTD¤¸¥ó§Y®É§ó·sªÑ»ù°ÝÃD??

½Ð°Ý
¤§«e³£¨Ï¥Î¤¸¤jYeswin¨Ó§Y®É§ó·sªÑ»ù
³Ìªñ§ï¥ÎRTD¤¸¥ó
¦ý¦b¨S¦³¶}±ÒRTD¤¸¥ó¤U¥´¶}ÀÉ®×
­n§ó·sªºÄæ¦ì³£¥X²{""?¨S¦³¸ê®Æ""
¦ý¬O¤§«e¥ÎYeswin
§Y¨Ï¦b¨S¦³¶}±ÒYeswin¤U¥´¶}ÀÉ®×
­n§ó·sÄæ¦ìÁÙ·|""¥X²{³Ì«á§ó·s¸ê®Æ""
RTD¦³¿ìªk³o¼Ë¶Ü?????
¥t¥~¦b¤w¶}±ÒRTD¤¸¥ó¤U
­n¦A¶}±Ò¥t¤@Àɮצ³¿ìªk¿ï¾Ü­n©Î¤£­n¨Ï¥ÎRTD¤¸¥ó§ó·s¶Ü??
¤p¤Hª«

¦^´_ 1# jasonwu0114
¦³½g¤å³¹¥i¨Ñ°Ñ¦Ò¡B¤Î«äºû¡G
dde | KenmingのÂA«äºû

TOP

¦^´_ 1# jasonwu0114

¬Oªº¡A¦pªG¤£¶}±ÒRTD¤¸¥ó´N·|¥X²{"?¨S¦³¸ê®Æ"¡A
¥t¥~¦b¤w¶}±ÒRTD¤¸¥ó¤U¬O¨S¿ìªk¿ï¾Ü­n©Î¤£­n¨Ï¥ÎRTD¤¸¥ó§ó·sªº¡A
¦]¬°´Nºâ§A¿ï¾Ü¤£­n§ó·s¡A¥LÁÙ¬O·|±j¨î§â§Aªº¸ê®Æ§ó·s¨ì²{¦bªº³ø»ù....

©Ò¥H¤£ºÞ¬O§A¤£¶}RTD¡A©Î¬O¿ï¾Ü¤£­n§ó·s¸ê®Æ¡A³£µLªk¹F¦¨§A­n¬Ý«e¤@¤éªº³ø»ùªº»Ý¨D¡A
¦]¦¹°ß¤@ªº¿ìªk´N¬O¼g­Óµ{¦¡¡AÅý¥L¨C¤é²£¥Í¤@­Ó·s¤u§@ªí©ÎÀɮסA¨Ã¥B¤º®e¥þ³¡Åܦ¨­È¦Ó¤£±a¤½¦¡¡A
À³¸Ó¥u¦³³o­Ó¿ìªk¤F¡C

TOP

¦^´_ 1# jasonwu0114
¦Û»s¬Ý½L



ThisWorkbook µ{¦¡½X
  1. Option Explicit
  2. Dim ie()  As Object
  3. Const Sh = "¬Ý½L"  '«ü©w¤u§@ªí¦WºÙ
  4. Private Sub Workbook_Open()
  5.     Dim i As Integer, T As Date
  6.     Workbook_BeforeClose False
  7.     With Sheets(Sh)
  8.         Application.StatusBar = "ºô­¶¤U¸ü¤¤..."
  9.         For i = 2 To .UsedRange.Columns(1).Rows.Count  'ªÑ²¼¥N¸¹
  10.             ReDim Preserve ie(2 To i)
  11.             If .Cells(i, "A") <> "" And IsNumeric(.Cells(i, "A")) And Len(.Cells(i, "A")) >= 4 Then
  12.                 Set ie(i) = CreateObject("InternetExplorer.Application")
  13.                 ie(i).Navigate "http://newmis.twse.com.tw/stock/fibest.jsp?stock=" & .Cells(i, "A")
  14.                 DoEvents
  15.                 Application.StatusBar = "¤U¸ü... " & .Cells(i, "A")
  16.                 ie(i).Visible = False
  17.             Else
  18.                 Set ie(i) = Nothing
  19.                 .UsedRange.Rows(i).Offset(, 1) = ""
  20.             End If
  21.         Next
  22.     End With
  23.     T = Time + #12:00:05 AM#
  24.     If Time < #9:00:00 AM# Then T = #9:00:00 AM#
  25.     Application.OnTime T, "ThisWorkbook.©Ò¦³ªÑ»ù"
  26. End Sub
  27. Private Sub §Y®ÉªÑ»ù(R As Integer)
  28.     Dim Element As Object, C As Integer
  29.     Application.EnableEvents = False
  30.     With Sheets(Sh)
  31.         If Not ie(R) Is Nothing Then
  32.             With ie(R)
  33.                 Do While .Busy Or .ReadyState <> 4: Loop
  34.                 Set Element = .document.getElementsByTagName("TABLE")(1) '
  35.             End With
  36.             For C = 0 To Element.Rows(1).Cells.Length - 1
  37.                 .Cells(R, C + 2) = Element.Rows(1).Cells(C).innertext
  38.             Next
  39.         Else
  40.             .UsedRange.Rows(R).Offset(, 1) = ""
  41.         End If
  42.     End With
  43.     Application.EnableEvents = True
  44. End Sub

  45. Private Sub ©Ò¦³ªÑ»ù()
  46.     Dim R As Integer
  47.     If Time >= #1:30:00 PM# Then
  48.         Workbook_BeforeClose False
  49.         Application.StatusBar = "  ¤w¦¬½L!!!"
  50.         Exit Sub
  51.     End If
  52.     For R = 2 To UBound(ie)
  53.         §Y®ÉªÑ»ù R
  54.     Next
  55.     Application.OnTime Time + #12:00:02 AM#, "ThisWorkbook.©Ò¦³ªÑ»ù"
  56.     Application.StatusBar = Time & vbTab & "§ó·s§¹¦¨"
  57. End Sub
  58. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  59.     Dim e As Variant
  60.     On Error Resume Next
  61.     For Each e In ie
  62.        e.Quit
  63.        Set e = Nothing
  64.     Next
  65. End Sub
  66. Private Sub Workbook_SheetChange(ByVal Wsh As Object, ByVal Target As Range)
  67.     If Wsh.Name = Sh Then
  68.         If Target.Column = 1 And Target.Row > 1 Then Workbook_Open
  69.     End If
  70. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

·PÁÂ
¦U¦ì«e½úªº·N¨£
¤p§Ì¥ý¨Ó®ø¤Æ¬ã¨s¤@¤U
ÁÂÁÂ
¤p¤Hª«

TOP

·s¤â¥ý¨ÓÆ[¼¯,·PÁ¤À¨É....

TOP

¦^´_  jasonwu0114
¦Û»s¬Ý½L
ThisWorkbook µ{¦¡½X
GBKEE µoªí©ó 2014-1-15 19:22
  1.         Workbook_BeforeClose False
  2.       '[color=Red] ¼W¥[Äæ¦ì¦WºÙ[/color]
  3.         Worksheets(Sh).Range("A1").Value = "ªÑ²¼¥N½X"
  4.         Worksheets(Sh).Range("B1").Value = "³Ìªñ¦¨¥æ»ù"
  5.         Worksheets(Sh).Range("C1").Value = "º¦¶^»ù®t(¦Ê¤À¤ñ)"
  6.         Worksheets(Sh).Range("D1").Value = "·í½L¦¨¥æ¶q"
  7.         Worksheets(Sh).Range("E1").Value = "²Ö¿n¦¨¥æ¶q"
  8.         Worksheets(Sh).Range("F1").Value = "´¦¥Ü¶R»ù"
  9.         Worksheets(Sh).Range("G1").Value = "´¦¥Ü¶R¶q"
  10.         Worksheets(Sh).Range("H1").Value = "´¦¥Ü½æ»ù"
  11.         Worksheets(Sh).Range("I1").Value = "´¦¥Ü½æ¶q"
  12.         Worksheets(Sh).Range("J1").Value = "¶}½L"
  13.         Worksheets(Sh).Range("K1").Value = "³Ì°ª"
  14.         Worksheets(Sh).Range("L1").Value = "³Ì§C"
  15.         Worksheets(Sh).Range("M1").Value = "»¡©ú"

  16.         With Sheets(Sh)
½Æ»s¥N½X
«Ü©êºp¡A§Ú¬O¤p¾Ç¥Í¡A¤£¯à¤U¸üÀɮסA¬O­Ó¤p§¾«Ä¡I

TOP

½Ð°Ý¥Î RTD ·|¤ñ DDE ¤è«K¶Ü

TOP

¤j¤j¯uªº«Ü¼F®`
¥¿¦b®ø¤Æª¾ÃѤ¤
ÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : ¤£©È¨Æ¦h¡A¥u©È¦h¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD