Solved

Program Hang

Posted on 1999-01-21
4
151 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
ID: 1469911
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
ID: 1469912
sorry..what i meant is totally goes hang...the line of code cannt execute anymore
0
 
LVL 1

Expert Comment

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

Accepted Solution

by:
HATCHET earned 30 total points
ID: 1469914
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 55
Determine Range to Select 5 52
Protecting vb6 & .Net code Obfuscation 18 150
adding "ungroup sheets" to existing vbs code 5 26
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

792 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