Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default The problem with comparison of text as well as the password from

I created form UserForm with TextBox and Button.

How to compare the string (text) from TextBox as well as password from
VBAProject Properties - Protection - Password.

I would like to mention, that I put propriety PasswordChar (for TextBox)
= *. Does this have some meaning?

What I should write in event CommandButton1_Click() ?

Kind Regards,
Andrzej
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default The problem with comparison of text as well as the password from t

You have no access to the project password programmatically. Certainly not
for reading and for setting the best you can do is sendkeys.

You should already know it, so you could include it in your code - but even
so, not sure of what purpose it would serve.

--

Regards,
Tom Ogilvy


"And1" wrote:

I created form UserForm with TextBox and Button.

How to compare the string (text) from TextBox as well as password from
VBAProject Properties - Protection - Password.

I would like to mention, that I put propriety PasswordChar (for TextBox)
= *. Does this have some meaning?

What I should write in event CommandButton1_Click() ?

Kind Regards,
Andrzej

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default The problem with comparison of text as well as the password fromt

OK,
and to what is the command ?:
"ActiveWorkbook.HasPassword"

Kind Regards,
Andrzej

Tom Ogilvy napisał(a):
You have no access to the project password programmatically. Certainly not
for reading and for setting the best you can do is sendkeys.

You should already know it, so you could include it in your code - but even
so, not sure of what purpose it would serve.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default The problem with comparison of text as well as the password fr

from help on HasPassword property of the workbook object:

True if the workbook has a protection password. Read-only Boolean.

Remarks
You can assign a protection password to a workbook by using the SaveAs method.

This has nothing to do with the project password in the vbe.

You can't lock a project without a password.

--
Regards,
Tom Ogilvy



Maybe you are looking for something like:

Application.VBE.ActiveVBProject.Protection


Which returns true if the activeproject in the vbe is locked.




"And1" wrote:

OK,
and to what is the command ?:
"ActiveWorkbook.HasPassword"

Kind Regards,
Andrzej

Tom Ogilvy napisał(a):
You have no access to the project password programmatically. Certainly not
for reading and for setting the best you can do is sendkeys.

You should already know it, so you could include it in your code - but even
so, not sure of what purpose it would serve.


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
Sumif - For Each problem (several column comparison) Mats W Excel Programming 1 November 24th 04 11:05 AM
Text Comparison bilswi[_2_] Excel Programming 0 November 5th 04 10:08 PM
Text Comparison bilswi Excel Programming 1 November 5th 04 04:55 PM
text comparison skippy Excel Programming 0 May 4th 04 02:20 PM
If then Cell comparison with text. SS[_3_] Excel Programming 1 February 2nd 04 10:50 PM


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

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"