The problem with comparison of text as well as the password from

A

And1

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
 
G

Guest

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.
 
A

And1

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

Kind Regards,
Andrzej

Tom Ogilvy napisał(a):
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top