ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Locking a Workbook (https://www.excelbanter.com/excel-programming/341731-locking-workbook.html)

Patrick Simonds

Locking a Workbook
 
I have a Workbook which has an Auto_Open Macro. The Auto_Open macro displays
a dialogbox which asks "Open as Read Only" or "Edit File". If they select
Open as Read Only I want one of two things. Either make the Workbook Read
Only or disable their ability to save the Workbook.

If they select Edit File, they are asked for a password and then taken into
the Workbook where they are allowed to make and save changes (this part is
working fine).



Tom Ogilvy

Locking a Workbook
 
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly

--
Regards,
Tom Ogilvy

"Patrick Simonds" wrote in message
...
I have a Workbook which has an Auto_Open Macro. The Auto_Open macro

displays
a dialogbox which asks "Open as Read Only" or "Edit File". If they

select
Open as Read Only I want one of two things. Either make the Workbook Read
Only or disable their ability to save the Workbook.

If they select Edit File, they are asked for a password and then taken

into
the Workbook where they are allowed to make and save changes (this part is
working fine).






All times are GMT +1. The time now is 08:59 PM.

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