ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set to Read Only (https://www.excelbanter.com/excel-programming/284347-set-read-only.html)

Eric[_14_]

Set to Read Only
 
Is it possible to set a workbook to Read Only at run time?

Jim Rech

Set to Read Only
 
If you mean that you want to open a workbook and then change it to
read-only, you can do it like this:

On Error Resume Next
ActiveWorkbook.Saved = True
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly

The On Error is in case the workbook is already RO.

--
Jim Rech
Excel MVP



Ron de Bruin

Set to Read Only
 
Check out ChangeFileAccess xlReadOnly
in the VBA help Eric

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Eric" wrote in message ...
Is it possible to set a workbook to Read Only at run time?





All times are GMT +1. The time now is 06:04 PM.

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