- ©«¤l
- 37
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 41
- ÂI¦W
- 0
- §@·~¨t²Î
- windows xp
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-7
- ³Ì«áµn¿ý
- 2018-2-10
|
¥»©«³Ì«á¥Ñ kobo ©ó 2012-2-13 21:28 ½s¿è
¦]ÅvµLªk¤U¸üÀÉ®×,¬G¶È´£¨ÑÓ¤H¨Ï¥Îddeªº¸gÅç¤À¨É
Worksheet_Calculate¨Æ¥ó:¦¹¨Æ¥ó·|¦b«·spºâ¤u§@ªí«áµo¥Í¡C
º¥ý¥²¶·²M·¡¤F¸Ñ¨Æ¥óIJµoªº¹Lµ{(¦h´ú¸Õ¦³§U©ó§Aªº¤u§@),
·í¶}±ÒÀÉ®×®É,excelªº¤u§@ªí¤¤¦p¦³dde³sµ²,pºâ¤½¦¡,©Î®É¶¡¨ç¼Æµ¥(«·spºâ¤u§@ªí)§¡·|IJµo¦¹¤@¨Æ¥ó,
©Ò¥H±z¤@¶}±ÒÀÉ®×¥B§ó·sdde®É,Àx¦s®æªºdde¸ê®Æ©|¥¼§ó·s§¹¥þ¦ÓCalculate¨Æ¥ó¤vIJµo,¬Gµo¥Í¿ù»~,
¸Ñ¨M¤èªk¦p¦P Hsieh ©Òz,
Ó¤H©Ò¨Ï¥Îªº¤èªk¬°«Ø¥ß¤@Ó¶}Ãö(¦p¦ó«Ø¥ß¨£¤¯¨£´¼)
¨Ò¦p:
Private Sub Worksheet_Calculate()
if [A1]=1 then Call Catch_DDE
End Sub
¤Wz[A1]¬°¶}Ãö,¥u¦³¦b[A1]=1®É,¤è°õ¦æCatch_DDE
¥tÁקKCalculateIJµo«á,©Ò°õ¦æªºµ{§Ç©|¥¼°õ¦æ§¹²¦¤S¦AIJµo¦Ó²£¥Í¿ù»~,
«ØijIJµo«á±N Application.EnableEvents = False
µ²§ô«á¦A±N Application.EnableEvents = True
¦p¤W¨Ò§ï¬°
Private Sub Worksheet_Calculate()
Application.EnableEvents = False
if [A1]=1 then Call Catch_DDE
Application.EnableEvents = True
End Sub
If IsError(.[J12]) Then Exit Sub ³o¤@¦æ «ç»ò¥[¤£¤W¥h¡A¥X²{½sĶ¿ù»~
¬ã§P±z¬O¦b½L¤¤×§ïµ{¦¡,dde¤@ª½§ó·s,¤£Â_IJµoCalculate,µ{¦¡½X¼g¤£§¹´NIJµo¨Æ¥ó,·íµM²£¥Í¿ù»~,
¦p¥H«á»Ý½L¤¤×§ï,«Øij¥i¥Î½Æ»sµ{¦¡½X¦A¶K¤W©Î¦bק諸¦æ¤W¥ý¥[ ' ,Åܦ¨µù¸Ñ«á¦A½s¼g,§¹¦¨«á¦A§R°£ '
SetLinkOnData ¤èªk:³]©w¨C·í§ó·s DDE ³s½u®É°õ¦æªºµ{§Ç¦WºÙ¡C
¥Ñ¦r¸q¤W»¡¦¹ªk¥u¦³¦b DDE ³s½u¸ê®Æ§ó·s®É¤è°õ¦æ ±zn³]©wªºµ{§Ç
¬G¦¹ªk»PWorksheet_Calculate¨Æ¥ó¦³¨Ç¤£¦P,¬O¥i¥H¤À¶}¨Ï¥Îªº
³o«üªºDDE¬O«ü¦³¤Þ¤J¦b¤u§@ªíªºDDE ¥N½X,
¶}½L»ù¡B³Ì°ª»ù¡B³Ì§C»ù¡B¦¨¥æ»ù¡B¦¨¥æ¶qµ¥¦U¦³¦UªºDDE¥N½X
¨Ò:
Sub ³]©w¦¨¥æ¶qDDE()'¥u¦³¦b¦¨¥æ¶q¸ê®Æ§ó·s®É¤~·|°õ¦æCatch_DDE,¨ä¥LDDE¥N½X§ó·s¤£·|°õ¦æ
ThisWorkbook.SetLinkOnData "YES|DQ!EXFB2.Volume", "Catch_DDE"
End Sub
Sub ¸Ñ°£¦¨¥æ¶qDDE()'¦¨¥æ¶q¸ê®Æ§ó·s®É ¤]¤£·|°õ¦æ¥ý«e©Ò³]©wªºµ{§Ç
ThisWorkbook.SetLinkOnData "YES|DQ!EXFB2.Volume", ""
End Sub
Worksheet_Calculate¨Æ¥ó »P SetLinkOnData ¤èªk ¦U¦³¦Uªº¯SÂI,ÁÙ±æ¨Ï¥ÎªÌ¦Û¦æ´ú¸Õ,
§ä¥X²Å¦X¦Û¤vªº»Ý¨D.
¯¬±z¾Ç²ß´r§Ö |
|