Solved

Program Hang

Posted on 1999-01-21
4
149 Views
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 ?
0
Comment
Question by:siang
  • 2
4 Comments
 
LVL 3

Expert Comment

by:HATCHET
Comment Utility
siang,

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.

HATCHET
0
 

Author Comment

by:siang
Comment Utility
sorry..what i meant is totally goes hang...the line of code cannt execute anymore
0
 
LVL 1

Expert Comment

by:rondeauj
Comment Utility
That type of problem would be handled by the operating system
0
 
LVL 3

Accepted Solution

by:
HATCHET earned 30 total points
Comment Utility
siang,

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.

http://www.cybermedia.com/products/firstaid/


HATCHET
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 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

6 Experts available now in Live!

Get 1:1 Help Now