VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

hit Esc key to stop VBA program smoothly during long processing

1 REPLY 1
Reply
Message 1 of 2
superjoe
403 Views, 1 Reply

hit Esc key to stop VBA program smoothly during long processing

it's a general question, hope you guys don't mind to give a hint, thanks.

by using following code, i have to set trapper of UserEscaped() to all over my program, is there a better or easy way?

Public Const VK_ESCAPE = &H1B
Declare Function GetAsyncKeyState Lib "user32" _
(ByVal vKey As Long) As Integer
Public Function UserEscaped() As Boolean
If GetAsyncKeyState(VK_ESCAPE) Then UserEscaped = True
End Function
1 REPLY 1
Message 2 of 2
pvictor
in reply to: superjoe

You mght look at the discussion of DOEVENTS in Help or in most comprehensive books on VB.

Victor

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost