|
-
Feb 2nd, 2014, 02:18 PM
#4
Re: Resume Next is not working in this case ...
 Originally Posted by Bruin1953
Unfortunately, "On Error Resume Next" does not work in this case, and THIS app will crash (in my case at least!).
...
Any idea why this error escapes trapping?
You've now discovered that VB's error trapping mechanism is ineffective against errors thrown by the OS (and also by Win32 APIs). Therefore, you should now use VB's error trapping statements judiciously; do not just sprinkle them everywhere. In particular, placing an OERN at the start of every procedure is very bad. You won't receive any useful error alerts (especially while debugging) because you chose to ignore all of them.
Having said that, how far is your code in Sub Timer1_Timer() able to go before it crashes? In order to determine that, you'll have to delete the OERN line and then log your code's activities to a file.
BTW, always keep the following reminder from MSDN in mind:
 Originally Posted by MSDN
The clipboard is user-driven. A window should transfer data to or from the clipboard only in response to a command from the user. A window must not use the clipboard to transfer data without the user's knowledge.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|