ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro on Password (https://www.excelbanter.com/excel-programming/414357-macro-password.html)

acss

Macro on Password
 
Is there a way to have a password protect on a workbook and once end user
keys in the password, the workbook status will changed to modified?

Gary Brown[_4_]

Macro on Password
 
the easiest way to do this is to have the workbook always believe it has been
changed as soon as you open it. In the ThisWorkbook module, put the
following macro...

Private Sub Workbook_Open()
Application.ActiveWorkbook.Saved = False
End Sub

That will make the workbook always believe that it needs to be saved.
--
Hope this helps.
Thanks in advance for your feedback.
Gary Brown


"acss" wrote:

Is there a way to have a password protect on a workbook and once end user
keys in the password, the workbook status will changed to modified?



All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com