LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Comparing password entry vs stored password - 2003

Hello --

A worksheet has a button which, when clicked, shows a list of sales regions
and allows changing the region on a quotation.
Users of the sheet are permitted to change the region, prior to preparing
the quote.

The completed quote (the workbook containing the sheet) is sent to the
customer, who can change other cells on the sheet (sensitivity analysis),
but not the sales region.

I currently have the following code on the button click to control access to
the regions list:
....
frmPWEntry.Show 'contains 1 field: txtPWEnter, for entry of password,
masked with "****"

strPassword = frmPWEntry.txtPWEnter.Value

If strPassword = "1234" Then
frmSelectRegion.Show 'listbox allows selection of region
End If

Unload frmPWEntry
....

Problem: User will occasionally want to change the workbook password via
menu selections, and would prefer not to also have to change VBA behind the
workbook in order to maintain the button's "protection".

Tom Ogilvy's recent mention of "ActiveWorkbook.HasPassword = ..." prompts me
to ask the following:

Is there an ActiveWorkbook. ... which knows the password and against which
VBA can test ("behind the scenes") the entered password string?

If so, my code could look like

strPassword = frmPWEntry.txtPWEnter.Value

If ActiveWorkbook. ... = strPassword Then
frmSelectRegion.Show
End If


Thanks for any help.

Larry Mehl


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.797 / Virus Database: 541 - Release Date: 11/15/2004


 
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
sql server password entry during macro run Carl Irving Excel Discussion (Misc queries) 0 October 23rd 07 05:22 PM
Password Entry Diane Mallin[_2_] Excel Programming 1 August 3rd 04 06:20 PM
Log Password Entry Attempts ExcelMonkey[_87_] Excel Programming 0 February 19th 04 08:43 PM
HOW can I add a PASSWORD entry box to my Excel app using VBA? Marcello do Guzman Excel Programming 2 December 13th 03 02:00 AM
How can I add a PASSWORD entry box to my EXCEL app using VBA Marcello do Guzman Excel Programming 1 December 11th 03 08:05 AM


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

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

About Us

"It's about Microsoft Excel"