Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default 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.

Reply
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
Password protection in macro ( Anybody can view my password in VB Sherees Excel Discussion (Misc queries) 2 January 24th 10 10:05 PM
How to retrive password protected worksheet but forgot password? Laurie Excel Worksheet Functions 1 November 19th 09 09:42 PM
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. Daniel Excel Worksheet Functions 0 June 23rd 05 11:56 PM
bypass password when update linking of password protected file Yan Excel Discussion (Misc queries) 1 February 7th 05 11:29 PM
VBa, Password protected sheet fails to get unprotected with the same password Hans Rattink Excel Programming 3 July 28th 03 02:30 PM


All times are GMT +1. The time now is 06:55 PM.

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

About Us

"It's about Microsoft Excel"