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

[µo°Ý] ½Ð±Ð¨Ï¥Îyeswin RTD, ¥¨¶°¶}±Ò«á¸ê®Æ´NµLªk§ó·s

[µo°Ý] ½Ð±Ð¨Ï¥Îyeswin RTD, ¥¨¶°¶}±Ò«á¸ê®Æ´NµLªk§ó·s

½Ð±Ð¦U¦ì«e½ú
¤p§Ì­ì¥ý³£¬O¨Ï¥Îeasywin ªºDDE ¸ê®Æ ¦ý«D±`ªº¦Y¸ê·½
³Ìªñµo²{¤¸¤jªº¥t¤@­Ó³nÅé Yeswin ¦³´£¨Ñ RTD ªº¸ê®Æ
©ó¬O§Ú±N­ì¥ýªº¥¨¶°µy§@­×§ï«á
§Ú¥D­n¬O·Q­n¥ý§â©Ò¦³ªº¸ê®Æ°O¿ý¤U¨Ó
©Ò¥H§Ú·|¥hÀˬd®É¶¡Åܰʪº®É­Ô´N½Æ»s¨ì¥t¤@­Ó¤À­¶

¦bDDEªºÀô¹Ò¨Ï¥Î®É³£«Ü¥¿±`,¦ý·í¸ê®Æ·½´«¦¨RTD«á,µo²{¥u­n¤@¶}±Ò§ÚªºMacro «á
RTDªº¸ê®Æ´N¤£°Ê¤F~
·Q½Ð°Ý¦U¦ì«e½ú³o­Ó¦³¿ìªk¸Ñ¨M¶Ü?
¬O¦]¬°§Úªºµ{¦¡¼gªk¤£¹ï¶Ü?

ÁÂÁÂ

¤jÀs
TX_Yeswin_1.zip (17.58 KB)

½Ð±Ð¦U¦ì«e½ú
¤p§Ì­ì¥ý³£¬O¨Ï¥Îeasywin ªºDDE ¸ê®Æ ¦ý«D±`ªº¦Y¸ê·½
³Ìªñµo²{¤¸¤jªº¥t¤@­Ó³nÅé Yeswin ¦³´£ ...
randychou µoªí©ó 2013-1-4 11:46

Yeswin ³ø»ù¤¸¥ó(RTD) ¬O¥¿±`ªº¡A  =RTD("money.excel",,,$A$7,"Price")
§A¥i¥Hª½±µ¼g¦¨  =RTD("money.excel",,"TXF1","Price")
¸Õ¸Õ¬Ý¡I
  1. Public turnKey As Integer

  2. Sub Macro_TX_DDE_COPY()
  3.     Dim nums As Integer
  4.    
  5.     nums = 20      '  20 ¬í (¹w³]­È)
  6.    
  7.     turnKey = turnKey + 1
  8.     Sheets("DDE_DATA").[A5] = "( " & turnKey & " ¬í )"
  9.    
  10.     If (Second(Time) Mod nums) = 0 Then    ' ¶¡¹j nums ¬í
  11.        With Sheets("RECORD_TX")
  12.             If Not IsError(Sheets("DDE_DATA").[D2]) Then
  13.                 pos = .Range("A" & Rows.Count).End(xlUp).Row + 1
  14.                 .Cells(pos, 1).Resize(1, 9) = Sheets("DDE_DATA").Cells(2, 1).Resize(1, 9).Value
  15.                 turnKey = 0
  16.             End If
  17.         End With
  18.     End If
  19.    
  20.     Application.OnTime (Now + TimeValue("00:00:01")), "Module11.Macro_TX_DDE_COPY"
  21. End Sub
½Æ»s¥N½X

TOP

ÁÂÁ c_c_lai ¤j ªº¸Ñµª. ¶g¤@¦A¨Ó¸Õ¸Õ¬Ý
«Ü·PÁÂ

TOP

¦^´_ 3# randychou
#2 ¼Óµ{¦¡½X¥u¬O³æ¯ÂÅý§A´ú¸Õ¬O§_¦³¸ê®Æ¿ý¹ê»Ú¼g¤J¦Ó¤w¡A
¦pªG§A­n¹ê»Ú°µ½L¤¤´ú¸Õ¡A«h¶·¥[¤J¶}¥«¡BÃö¥«¸ê°T¡A
«h½Ð§ï¦¨¦p¤U¡G
  1. Public turnKey As Integer

  2. Sub Auto_Open()
  3.     If (TimeValue(Now) >= TimeValue("13:45:00")) Then      '  ³]©w¨C¤éÃö¥«®É¶¡
  4.         Exit Sub
  5.     ElseIf (TimeValue(Now) <= TimeValue("08:45:00")) Then   '  ³]©w¨C¤é¶}¥«®É¶¡
  6.         Application.OnTime (TimeValue("08:45:00")), "Module11.Macro_TX_DDE_COPY"
  7.     Else
  8.         '  ¨t²Î­è³s¤W Yeswin³ø»ù¤¸¥ó(RTD) COM ¾÷¨î¡A¶·¦³¤@­Ó½w½Ä®É¬q¡A³o®É¦pªG°¨¤W
  9.         '  ¥h§ì¨ú¸ê®Æ¡A·|¦³«¬ºA¤£²Åªº¿ù»~°T®§ (?µL¸ê®Æ) ²£¥Í¡A¨Ã¤¤Â_°õ¦æ§Çªº§@·~¡C
  10.         Application.OnTime (Now + TimeValue("00:00:05")), "Module11.Macro_TX_DDE_COPY"
  11.     End If
  12. End Sub

  13. Sub Macro_TX_DDE_COPY()
  14.     Dim nums As Integer
  15.    
  16.     nums = 20      '  20 ¬í (¹w³]­È)
  17.    
  18.     turnKey = turnKey + 1
  19.     Sheets("DDE_DATA").[A5] = "( " & turnKey & " ¬í )"
  20.    
  21.     If (Second(Time) Mod nums) = 0 Then    '  ¶¡¹j nums ¬í¡AÀx¦s¤@µ§¸ê®Æ¦C
  22.        With Sheets("RECORD_TX")
  23.             If Not IsError(Sheets("DDE_DATA").[D2]) Then          '  Á׶}«¬ºA¤£²Åªº¿ù»~°T®§
  24.                 pos = .Range("A" & Rows.Count).End(xlUp).Row + 1  '  ©¹¤U¥[¤@µ§¸ê®Æ¦C
  25.                 .Cells(pos, 1).Resize(1, 9) = Sheets("DDE_DATA").Cells(2, 1).Resize(1, 9).Value
  26.                 turnKey = 0  '  turnKey ­ÈÂk¹s
  27.             End If
  28.         End With
  29.     End If
  30.    
  31.     If (TimeValue(Now) <= TimeValue("13:45:00")) Then _
  32.         Application.OnTime (Now + TimeValue("00:00:01")), "Module11.Macro_TX_DDE_COPY"
  33. End Sub
½Æ»s¥N½X

TOP

©I©I!! ÁÂÁÂCC¤j ¥i¥H°Ê¤F
¥t¥~¦³­Ó¤p°ÝÃD½Ð±Ð¤@¤U
§Ú¦brun ¥¨¶°ªº®É­Ô ¹Á¸Õ¥h¶}¥t¥~¤@­Óexcel ´N·|¥X¿ù "°õ¦æ¶¥¬q¿ù»~ 9"
³o­Ó¬O¤£¬OEXCELªº­­¨î©O?

TOP

¿ù»~¬Oµo¥Í¦b
#4¼Óªº ²Ä24¦æ
       With Sheets("RECORD_TX")

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-1-7 12:43 ½s¿è
¿ù»~¬Oµo¥Í¦b
#4¼Óªº ²Ä24¦æ
       With Sheets("RECORD_TX")
randychou µoªí©ó 2013-1-7 10:24

¦pªG¦P®É¶}±Ò¤@°¦¥H¤W±a¦³VBAµ{¦¡½Xªº Excel ÀÉ¡A±`·|¸I¨ì¦¹Ãþªº±¡ªp¡A
³o¤]¥i¯à¬O Excel ªº BUG¡F¥ç§Y¥¦­Ì¦b³B²z¥¨¶°®É¡A¬Û¤¬¶¡¿ù¶Ã§ì¿ù°ïÅ|
¦Óµo¥Í»~§Pªº¿ù»~¡A©Ò¥H°ò¥»¤W¦pªG§Ú¬O¦b½u¤W¶]¸ê®Æ®É¡A§Ú¶È¥u¶}±Ò¤@°¦
Excel µ{¦¡¡A¥H§K¦Û¤v­×²z¦Û¤v¡A¨S¨Æ§ä´í¡C

P.S.  ¦p­n¦^´_¹ï¤è®É¡A½Ð§»ª¤WÂI«ö "¦^´_" ¿ï¯Ã¡A¦p¦¹¹ï¤è¤~ª¾¹D§A¦³¦^´_¥L¡C

TOP

¦^´_ 7# c_c_lai

ÁÂÁÂCC¤j!! ¤£¦n·N«ä³á! ­è¨Ó¨S¦h¤[¨Sª`·N¨ì­n«ö¨ºÃä¦^´_,¤U¦¸´Nª¾¹D¤F ^^
­è­è³o­Ó°ÝÃD ¦bºô¸ô¤W·j´M ¦³¤H´£¨ì»¡³oºØ°ÝÃD¦n¹³¥u¯à¥ÎVB.NET ¤§Ãþªºµ{¦¡¥h­«·s§ï¼g
§Ú¤]¤£¤Ó²M·¡­n«ç»ò§Ë! :lol

TOP

¦^´_  c_c_lai

ÁÂÁÂCC¤j!! ¤£¦n·N«ä³á! ­è¨Ó¨S¦h¤[¨Sª`·N¨ì­n«ö¨ºÃä¦^´_,¤U¦¸´Nª¾¹D¤F ^^
­è­è³o­Ó°ÝÃD ...
randychou µoªí©ó 2013-1-7 13:05

C/C++,Pascal,VB/VB.Net µ¥½sĶ¥X¨Óªº°õ¦æ½X§¡ÄÝ©ó¾÷±ñ½X
(Real Machine Code) , ¦Ó VBA ¬Oª½Ä¶½X (Interpreter)¡A¨âªÌ
¬O¤£¦P¼h¦¸ªº½sĶ¤è¦¡¡C¦Ó¥B VBA ¶È¤î©ó Office¡C

TOP

¦^´_ 2# c_c_lai
½Ð±ÐC¤j¡A
§Ú¶}¤¸¤jRTD³ø»ù¤¸¥ó¡A¦A¶}¤é²±¹d´IĹ®a¡A©_©Ç  ¤é²±¹d´IĹ®aªºDDE¤£·|°Ê¡A¤£ª¾­n¦p¦ó¸Ñ¨M?
devidlin

TOP

        ÀR«ä¦Û¦b : °µ¦n¨Æ¤£¯à¤Ö§Ú¤@¤H¡A°µÃa¨Æ¤£¯à¦h§Ú¤@¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD