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

Ãö©óvba¦b¶]®É«ö¤Uescªº°ÝÃD

Ãö©óvba¦b¶]®É«ö¤Uescªº°ÝÃD

¦pªþ¥ó
§Ú¦³¤U¶]°j°é
¦ý¹J¨ì¤@­Ó°ÝÃD
¦b¶]ªº®É«J¡A­Y«öesc´N¯}¸Ñ¤F¡C

¥i§_Åý¥L¦b¶]®É¡Aesc«ö¤F¨S®Ä
§Ú¬O§Æ±æ¥L¶]§¹¡A§PÂ_®É¶¡¡AÅý§Ú³]©wªº®É¶¡¤º«ö¶s¦³®Ä¡A®É¶¡¥~«ö¶sµL®Ä¦Ó¥BÃö³¬

nb.rar (28.53 KB)

¦^´_ 1# ¥®¸X¶é­¸¤Ñ½Þ
µ{¦¡¤¤¨Ï¥Î Application.EnableCancelKey=xlDisabled
»¡©úÀɤ¤ªº»¡©ú:
±±¨î Microsoft Excel ¹ï¨Ï¥ÎªÌ¨Ï¥Î CTRL+BREAK (©Î ESC¡BCOMMAND+PERIOD) Á䤤Â_µ{¦¡°õ¦æªº³B²z¼Ò¦¡¡CŪ/¼g XlEnableCancelKey ¸ê®ÆÃþ«¬¡C
XlEnableCancelKey ¥i¥H¬O³o¨Ç XlEnableCancelKey ±`¼Æ¤§¤@¡C
xlDisabled¡C¹ï [¨ú®ø] Á䪺°»´ú¥\¯à§¹¥þµL®Ä¡C
xlErrorHandler¡C±N¤¤Â_§@¬°¿ù»~«H¸¹¶Ç»¼µ¹°õ¦æµ{¦¡¡A¥Ñ On Error GoTo ³¯­z¦¡³]©wªº¿ù»~³B²zµ{¦¡°»´ú¡C¥i°»´ú¿ù»~¥N½X¬° 18¡C
xlInterrupt¡C¤¤Â_¥Ø«e°õ¦æµ{¦¡¡A¨Ï¥ÎªÌ¥i¥H¶i¦æ°»¿ù©Î¨ú®øµ{¦¡ªº°õ¦æ¡C

µ{¦¡µ²§ô«e°O±o¨Ï¥Î
Application.EnableCancelKey=xlInterrupt  «ì´_¨Ï¥ÎªÌ¥i¥H¶i¦æ°»¿ù©Î¨ú®øµ{¦¡ªº°õ¦æ

TOP

·PÁÂGBKEE ¤jªº¦^À³
µ{¦¡­×§ï«á¥i¥H¥Î¤F

GBKEE ¤j§A»¡©Òªº
­Yerror¥i¥H¸õ¦Ü«ü©wªºµ{¦¡
³o¬qÁöµM¬Ý±oÀ´
¦ývba«o¤£ª¾«ç»ò¼g
¥i¦³½d¨Ò?

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-8-5 14:03 ½s¿è

¦^´_ 3# ¥®¸X¶é­¸¤Ñ½Þ
»¡©úÀɤWªº½d¨Ò
  1. Dim X&
  2. On Error GoTo handleCancel
  3. Application.EnableCancelKey = xlErrorHandler
  4. MsgBox "This may take a long time: press ESC to cancel"
  5. For X = 1 To 1000000    ' Do something 1,000,000 times (long!)
  6.     Debug.Print X '' do something here
  7.    
  8. Next X
  9. handleCancel:
  10. If Err = 18 Then
  11.     MsgBox "You cancelled"
  12. End If
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦Û¤v®`¦Û¤v¡A²ö¹L©ó¶ÃµoµÊ®ð¡C
ªð¦^¦Cªí ¤W¤@¥DÃD