Getting Excel password using vba

  • Thread starter Thread starter bala_psgtech
  • Start date Start date
B

bala_psgtech

hi

Can you please help in solving a problem in excel/VBA...

iam having a excel sheet which is protected by a password....

inorder to do some operations through VBA, first i must unportect

the work sheet.....for this i need the password to unprotect the

sheet...currently i have hardcoded it in my code........but when the

user changes the password......wat will be the case....???? again i

should go to the code and change ....

so, do u guys know how to get the password (which is set by the user
through VBA..

please help me.....

regards
bal
 
There is no way to retrieve a password with VBA. That would defeat the
purpose of having a password.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Hi
Don't let them change the password.
Unprotect your sheet using VBA to run any code. Run the code then
protect again using VBA.
If users need to edit the sheet, unlock any cells you want them to
have control over.

Working around users own passwords is above and beyond the call of
duty!

regards
Paul
 
Though for worksheet and workbook passwords, you can get the
equivalent hashed password using the algorithm found here:

http://www.mcgimpsey.com/excel/removepwords.html

Reapplying the same hash leaves the workbook/worksheet password in
the same state - the user will never know you've "changed" it, and
the original password will work fine.

Don't disagree with it defeating the purpose of having a password,
though. <g>
 
Back
Top