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

VBAªº DDE ¨ç¼Æ §ì¨ú

VBAªº DDE ¨ç¼Æ §ì¨ú

¥»©«³Ì«á¥Ñ Scott090 ©ó 2017-9-22 14:26 ½s¿è

Àµ½Ð¨ó§U¦p¦ó¥¿½T¨ú±o¸ê®Æ

¬Ý½L³nÅ饴¶}¡AÀx¦s®æ©ñ¤J DDE¤½¦¡¬O¥i¥H¨ú±o¸ê®Æªº¡C
§Æ±æ¥ÎDDE¨ç¼Æ¨Ó°µ³o¤@¥ó¨Æ¡A¦ý¨S¯à¦pÄ@¡A
¦p¤Uªºµ{¦¡¡G
1. Application.DDEInitiate("EWinner", "RQ") ¥i¥H¥´¶}DDE³q¹D
2. returnList = Application.DDERequest(ChannelNum, "'100000.Open'") ³z¹L³q¹D°e¥X item  '100000.Open'
    ´NµLªk¨ú±o¸ê®Æ¡F returnList ¤º¬O¦r¦ê "¿ù»~ 2023"
  1. ''DDE®æ¦¡¡GServerName|Topic!Item
  2. ''Àx¦s®æ¤º¤½¦¡
  3. ''¶}½L»ù¡G=EWinner|RQ!'100000.open'
  4. ''³Ì°ª»ù¡G=EWinner|RQ!'100000.high'
  5. ''³Ì§C»ù¡G=EWinner|RQ!'100000.low'
  6. ''¦¨¥æ»ù¡G=EWinner|RQ!'100000.price'
  7. ''
  8. Sub DDELinkTest()
  9.    
  10.     Dim ChannelNum As Long
  11.     Dim i%, j%
  12.     Dim returnList
  13.         
  14.     '«Ø¥ßDDE³sµ²³q¹D
  15.     'DDEInitiate(AppName, Topic)
  16.     Do
  17.         ChannelNum = Application.DDEInitiate("EWinner", "RQ") 'ÂIª÷ÆFªºAppName¡GEWinner¡BTopic¡GRQ
  18.         i = i + 1
  19.     Loop While i < 50 And ChannelNum = 0    '½T»{¤w«Ø¥ß³q¹D
  20.    
  21.     If ChannelNum <> 0 Then
  22.         'DDERequest(channel, item)¡A item = stockNumber 100000.Open ´ú¸Õ¤j½L 100000 ¶}½L»ù
  23. '         Àx¦s®æ¤º¤½¦¡ "=EWinner|RQ!'100000.open'"
  24.             returnList = Application.DDERequest(ChannelNum, "'100000.Open'")
  25. ''
  26.             On Error GoTo ErrorHand
  27.             '¨ú±o¸Ó¶µ¥Øªº¸ê®Æ¤º®e
  28.             For j = LBound(returnList) To UBound(returnList)
  29.                 ActiveSheet.Cells(75, i + 1).Formula = returnList(j)
  30.             Next
  31.         
  32.     End If
  33.         
  34. ErrorHand:
  35.     On Error GoTo 0
  36.     'Ãö³¬DDE³sµ²³q¹D
  37.     Application.DDETerminate ChannelNum
  38. End Sub
½Æ»s¥N½X

¥»©«³Ì«á¥Ñ kingmvp ©ó 2017-10-25 16:11 ½s¿è

¦^´_ 1# Scott090
Scott090¤j§A¦n....
²Ä24¦æ---> returnList = Application.DDERequest(ChannelNum, "'100000.Open'")
§â³æ¤Þ¸¹®³±¼¬Ý¬Ý....¦p¤U.....
returnList = Application.DDERequest(ChannelNum, "100000.Open")
¥t¥~....¦pªG¯uªº¤£¦æ....¤£§«¥ý¸Õ¸Õ¤p§Ì¦³¤@©«µo¤å¸ÌªþªºÀÉ®×..¥Î¥¦¦A¨Ó§ó§ïScott090¤jªþªºµ{¦¡½X......
http://forum.twbts.com/viewthread.php?tid=20214
but....¤p§Ìªþªº¨º­ÓÀÉ®×....¥¦§ìªº¨ìdata....¦ý....·|º|µ§....(¤p§Ì¤]¦³µo¤å½Ð±Ð....¤£¹L©|¥¼¦³«e½ú«üÂI....T__T)

TOP

¦^´_ 2# kingmvp


    ÁÂÁÂkingmvp¥Sªº¦^À³
Application.DDERequest(ChannelNum, "'100000.Open'")
§ï¦¨   Application.DDERequest(ChannelNum, "100000.Open") ÁÙ¬O¤£¦æ "¿ù»~ 2023"

¤£ª¾¬O§_ Ewinner³o­Ó¬Ý½Lµ{¦¡ªº·¾³q°ÝÃD¡F¤£¹L¥Î¬Û¦Pªº®æ¦¡¤½¦¡ª½±µ©ñ¨ì Àx¦s®æ¤º¬O¥i¥Hªº

TOP

¦^´_ 3# Scott090
Scott090¤j§A¦n....­n§P©w¬O§_¬°Ewinner·¾³q°ÝÃD....ª½±µ¸Õ¸Õ¤p§Ì¤W­±´£ªºÀÉ®×(À£ÁYÀɸ̪ºexcel)...§â¥¦´À´«¦¨Ewinneªº³sµ².....
¦pªG¤@¼Ë¦³°ÝÃDªº¸Ü....¨º´N½T©w¬OEwinner¥N½X¨S§Ë¦n....³o¼Ë¤ñ¸û§Öª¾¹D¬O­þ¸Ì¥X¤F°ÝÃD....
¥H¤W´£¨Ñµ¹Scott090¤j°Ñ¦Ò.....

TOP

¦^´_ 4# kingmvp


    ±q·s¦p©Ò«Øij¡AÁÙ¬O¤£¯à¥Î
°²¦p¦³½Ö­è¦n¤]¬O¥ÎÂIª÷ÆFªº¸Ü¤]¥i¸Õ¸Õ¬Ý

ÁÂÁÂ

TOP

¬O Application.DDERequest ¦Û¨­ªº°ÝÃD

TOP

        ÀR«ä¦Û¦b : ­×¦æ­nô½t­×¤ß¡AÂǨƽm¤ß¡AÀH³B¾i¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD