Re: userform crashes some computers; not mine
- From: "Rick Rothstein" <rick.newsNO.SPAM@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 13 Feb 2009 12:17:28 -0500
I have no idea what may be causing your problem, but here is a method that might help you narrow down the location where the problem is occurring at... ASSUMING your program actually starts to run before crashing and that the crash does not remove the UserForm from the screen. Just copy paste the following code line into your program at several locations (the more the better) throughout your code on any one of the computers that crash when running your code...
Me.Caption = Val(Me.Caption) + 1
Then, when your program crashes, the number displayed in the UserForm's Caption will tell you how far you got before the crash. You can then Delete all of the above lines (Replace All the statement's text with "") and then copy/paste it starting with each line after the crash point's location for, say, 10 lines or so. Then when you run the program, you will get a new crash point location. If it is within the lines you pasted the above statement, you are done and you have the line causing you your problems; if it isn't within the lines you pasted, delete them and do the next 10 lines or so. Eventually, you should be able to hone in on the trouble spot.
--
Rick (MVP - Excel)
"Ken" <krcowen@xxxxxxx> wrote in message news:096d184d-884a-43e4-8523-e061842a7453@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a rather involved userform (~350 textboxes spread through a 5
page multipage control) that is populated with data and data analysis
from a SQL query that is attached to a worksheet. It runs fine on my
computer; but crashes on everyone else's computer. The error message
they get is the useless one about e-mailing Microsoft; no line number,
error message or anything to help me track down the issue and the
computers freeze. When I debug the code on a machine that it fails
on, and step through the code which takes a about a minute it works.
I can accelerate that process by running to the cursor after the major
loops and it always works. Subsequent to stepping through the code
once, it always works for the remainder of the session. The user
closes the file and reopens and it crashes; unless I step through the
code once. I have cleaned the code, I have compared the VBA
references and they are all the same, all the computers are running
Excel 2003 SP3. There are only a few hundred rows of data and the
file is only 5M so I don't think it is a hardware limitation on the
other machines. None of the computers have any problem running the
query to get new data or refreshing the query.
I am now totally out of things to even consider that could cause the
failure on everyone else's computers unless they step through the code
first. Does anyone have any ideas?
Thanks
Ken
.
- References:
- Prev by Date: RE: Selecting multiple sheets
- Next by Date: Set the values of set of ranges to zero then restore previous valu
- Previous by thread: userform crashes some computers; not mine
- Next by thread: Re: userform crashes some computers; not mine
- Index(es):
Relevant Pages
|