|
-
Jul 25th, 2011, 07:58 AM
#1
Thread Starter
Member
[Excel VBA] Advanced activate/select question
As usual, I was working on a program written by someone else. This program took a long time to run, sometimes several hours. And, the worst part is, if you tried working on other stuff, it would often mess up. I figured out the problem, which was just that it activated a worksheet and then used that in the code. So, often if you worked on something else, you'd click back on a different workbook and it'd unactivate the worksheet that needed to be activated and the rest of the loop would not work. I got rid of every instance of select and activate and the problem is gone.
The same problem often happened even if you did NOT work on anything else, BUT your computer locked up. That is, our computers automatically lock after 10 minutes or so if left idle, and then you have to retype in your password to unlock it. This event also seemed to mess up the program in the same way described above, but no longer messes it up after I took out select and activate.
QUESTION: Does the process of your computer locking (in Win XP) unactivate the current workbook, or worksheet or something? Because that's the only way the program could mess up like that, as far as I can see.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|