Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asking for password when closing workbook excel 2002

Status
Not open for further replies.

christhedonstar

Programmer
Apr 9, 2007
215
GB
Hi,

On some PCs when an excel session is shut with a specific sheet a vba project password prompt comes up, asking for the password for the file. Any idea why this happens?

Thanks,

Chris
 
I can only guess that there is a bug in one of the procedures perhaps in Workbook_Close. When you close your excel you trigger a code with a bug and that would normally take you to visual basic editor but is not doing that because of password protection. The code might have a reference to something (object/range) in the "activesheet" which would explain why it crashes only for specific sheet i.e. excel sees activesheet as your currently selected sheet which may not have something used within a macro.

hope this helps a little
 
Good suggestion. Funny how some machines it causes an issues and on some it doesn't. The thing is when I enter the password it doesn't open up the debugger the worksheet just closes....?
 
Hi christhedonstar,

Try repairing the office installation onthe affected PCs (Help|Detect & Repair). If that doesn't solve the problem, try removing the password on one of the problem PCs, then see what happens when you try to close the workbook - the vbe should then be able to take you to the problem line in the code.


Cheers
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top