ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting Excel password using vba (https://www.excelbanter.com/excel-programming/283079-getting-excel-password-using-vba.html)

bala_psgtech

Getting Excel password using vba
 

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

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Chip Pearson

Getting Excel password using vba
 
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


"bala_psgtech" wrote in message
...

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
bala


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/




Paul Robinson

Getting Excel password using vba
 
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

bala_psgtech wrote in message ...
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
bala


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/


J.E. McGimpsey

Getting Excel password using vba
 
Though for worksheet and workbook passwords, you can get the
equivalent hashed password using the algorithm found he

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


In article ,
"Chip Pearson" wrote:

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



All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com