On workbook open

  • Thread starter Thread starter cimento cola
  • Start date Start date
C

cimento cola

Hello all.
Wonder if anyone can help me:

I have one workbook, that, when it opens, asks for a password, if it is
correct continues, else closes:

Private Sub Workbook_Activate()
Dim ask As String

ask = InputBox("Password: ", "Password protection")

If (ask = "password") Then
ThisWorkbook.Activate
Else
MsgBox ("Wrong password!!!")
ThisWorkbook.Close
End If

End Sub

My questions:
1 - When the workbook opens, asking the user for the password, all data in
the worksheet is visible... how can i hide it? Or at least not show it until
the password is entered correctly?
2 - When the user types the password, it´s in plain text... is there a way
to mask it to ****?
3 - When opening the workbook, if the user chooses the "no macros" option
(or at least not to activate them), all data is visible without password...
how can i change this?

Hope anyone can help... thanks in advance,

Cimento Cola
 
Why not just save the file with a password?

File/SaveAs, click "Options" and enter a Password to open.
 

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

Back
Top