Program Hang

Posted on 1999-01-21
Last Modified: 2010-05-03
how do i know that my program is Hang ? and can i write a code to detect and skip it ?
Question by:siang
  • 2

Expert Comment

ID: 1469911

In the Functions and Subs you write, make sure to at least put "On Error Resume Next" if not a more extensive error trap to ensure you're program runs smoothly and bows out gracefully if it does crash or encounter an error.  Here is an example of what I mean:


Private Sub Form_Load()
On Error Resume Next
  Dim MyVariable(10) as String

  MyVariable(11) = "Hello"

End Sub

In this example, if you did not AT LEAST have the "On Error Resume Next", you'd get Run-Time Error #9 - "Subscript out of range".  This will make your programming a lot easier.


Author Comment

ID: 1469912
sorry..what i meant is totally goes hang...the line of code cannt execute anymore

Expert Comment

ID: 1469913
That type of problem would be handled by the operating system

Accepted Solution

HATCHET earned 30 total points
ID: 1469914

Go to the following URL and check out a program called "First Aid".  I've had it for several years and LOVE IT!  It will catch any crashes that happen and tell you what caused the crash, give you information on the stack dump and error source, then allow you to automatically fix the problem and resume where you left off.  It also has a utility that will scan your system for resource or hardware conflicts and fix them for you.


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now