- ©«¤l
- 519
- ¥DÃD
- 54
- ºëµØ
- 0
- ¿n¤À
- 595
- ÂI¦W
- 261
- §@·~¨t²Î
- win 10
- ³nÅ骩¥»
- []
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-3-19
- ³Ì«áµn¿ý
- 2024-11-30
|
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"- ''DDE®æ¦¡¡GServerName|Topic!Item
- ''Àx¦s®æ¤º¤½¦¡
- ''¶}½L»ù¡G=EWinner|RQ!'100000.open'
- ''³Ì°ª»ù¡G=EWinner|RQ!'100000.high'
- ''³Ì§C»ù¡G=EWinner|RQ!'100000.low'
- ''¦¨¥æ»ù¡G=EWinner|RQ!'100000.price'
- ''
- Sub DDELinkTest()
-
- Dim ChannelNum As Long
- Dim i%, j%
- Dim returnList
-
- '«Ø¥ßDDE³sµ²³q¹D
- 'DDEInitiate(AppName, Topic)
- Do
- ChannelNum = Application.DDEInitiate("EWinner", "RQ") 'ÂIª÷ÆFªºAppName¡GEWinner¡BTopic¡GRQ
- i = i + 1
- Loop While i < 50 And ChannelNum = 0 '½T»{¤w«Ø¥ß³q¹D
-
- If ChannelNum <> 0 Then
- 'DDERequest(channel, item)¡A item = stockNumber 100000.Open ´ú¸Õ¤j½L 100000 ¶}½L»ù
- ' Àx¦s®æ¤º¤½¦¡ "=EWinner|RQ!'100000.open'"
- returnList = Application.DDERequest(ChannelNum, "'100000.Open'")
- ''
- On Error GoTo ErrorHand
- '¨ú±o¸Ó¶µ¥Øªº¸ê®Æ¤º®e
- For j = LBound(returnList) To UBound(returnList)
- ActiveSheet.Cells(75, i + 1).Formula = returnList(j)
- Next
-
- End If
-
- ErrorHand:
- On Error GoTo 0
- 'Ãö³¬DDE³sµ²³q¹D
- Application.DDETerminate ChannelNum
- End Sub
½Æ»s¥N½X |
|