LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Step-through works, Run does not?

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros: Step Thru Works, Run Works, Keyboard Shortcut Locks up BEEJAY Excel Programming 2 October 3rd 06 06:46 PM
It works when I step through it but it won't run chillihawk Excel Programming 5 June 5th 06 11:13 PM
Macro Works but not in Debug Step mode Bob Smedley[_2_] Excel Programming 3 January 31st 06 04:28 PM
macro works differently when using the Step Into (F8) feature Dave Y[_4_] Excel Programming 1 June 24th 05 03:06 AM
Works if I single step -\) Excel Programming 3 December 7th 04 04:24 PM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"