View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected][_2_] thesquirrel@gmail.com[_2_] is offline
external usenet poster
 
Posts: 39
Default Step-through works, Run does not?

I made a copy of my code if anyone was interested to see it...

Its the full Next button code, form initialize and form activation
along with the helper functions

http://home.socal.rr.com/wowggw/Stuff/Example.bas


On Oct 31, 10:27 am, "
wrote:
I had a very similar problem with a program I was running. I didn't
find that the saving of the workbook "fixed" the problem until I was
about ready to give up. Still to this day no one can give me an answer
as to what the exact problem was.

My program was a 6 form wizard that built a budget for our company.
The first three forms ran fine, until the user pressed the next button
to head to the fourth form where I too had a Multipage. When the user
presses next, there was about a 70% Excel crash (not a VBA crash). I
found that if I also went to the users machine where the crash occured
and stepped through it, the crash would NEVER happen, but at full
speed, it would crash. I ended up "fixing" it the cheezy way and just
adding:

'Lets save this thing to work around the problem...
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True

It works and now we are using the program, but I still want to find a
real fix for this problem. My code (which is too long to post here)
did closing functions for the third form and initialization and
activation for the fourth form. During the initialization and
activation, it loaded information for 40 textboxes, 24 of which had
change functions.

Anyway, I will be watching this post for any new information.

theSquirrel



Othello wrote:
Hello all:
I have a big (lots of code) multipage userform that asks a user for a
password which is on a list in a hidden sheet, in the first column. This
list was previously populated, randomized, by another form, and is different
for each occasion.


When the password is entered the form loops through the first column looking
for a match. If one is found, the form is populated with any existing data
from that row on the sheet, and then allows the user to step through 14 pages
of survey, or save for later at any point in the process. Here's the problem:


The form runs perfectly on my computer (the actual file sits on the public
drive, accessible by all authorized users), but when anyone else tries to run
it, it fails and crashes Excel. All of us are using Excel 2003. If I sit
down at that user's computer, open VBE and step through the procedure to find
the trouble, it goes all the way through and opens the form very nicely.
Further, if I then save it, that user can open it and run it at normal speed
with no trouble - everything works!


It works until I do the same thing from someone else's computer and then
only that person can run it. Except that I can still run it from my
workstation.


So, any hints? Why would step-through work when run won't, and why would
that temporarily fix it, and what does that mean about where to look for the
trouble?


I'll add in the code for the loop here, because that would seem to be the
most likely trouble spot, though it could easily be somewhere else.


Private Sub cmdEnterPassword_Click()
' Check to see if the password is in the evaluation file
Application.ScreenUpdating = False
If txtPassword.Value = "" Then 'Check for blanks
Application.ScreenUpdating = True
MsgBox ("That Password was not found. Please try again.")
End
End If


'Unprotect the sheet and open the hidden sheet to look at passwords
ActiveSheet.Unprotect ("appraisal")
ActiveWorkbook.Sheets("Data").Activate


'Start from the top
Range("A1").Select


Do
If txtPassword.Value = "" Then
Application.ScreenUpdating = True
MsgBox ("That Password was not found. Please try again.")
End
End If


If ActiveCell.Value = txtPassword Then


Application.ScreenUpdating = True


ElseIf ActiveCell.Value = 0 Then
'Go back to the cover sheet
ActiveWorkbook.Sheets("Start").Activate
Application.ScreenUpdating = True
MsgBox ("That Password was not found. Please try again.")


End


'If the entry is nonzero but not found yet, keep looking


ElseIf ActiveCell.Value < txtPassword Then
ActiveCell.Offset(1, 0).Select


End If
Loop Until ActiveCell.Value = txtPassword


Any suggestions will be very welcome!


Regards,
Othello- Hide quoted text -- Show quoted text -