Good morning,
Is it possible to change the Read Only status of a workbook once it has been opened via VBA?
Thanks,
Good morning,
Is it possible to change the Read Only status of a workbook once it has been opened via VBA?
Thanks,
Somewhere in the dark and nasty regions where nobody goes, stands an ancient castle.
Deep within this dank and uninviting place lives Berk, overworked servant of The Thing Upstairs.
But thats nothing compared to the horrors that lurk beneath The Trap Door.
Function IsReadOnly(sWorkBook As String) As Boolean Dim sFileFullName As String sFileFullName = Workbooks(sWorkBook).FullName If vbReadOnly Then IsReadOnly = True Else: IsReadOnly = False End If End Function Sub test() 'change activeworkbook.name to any file you want to test If IsReadOnly(ActiveWorkbook.Name) Then MsgBox "This workbook is read only" End Sub
Last edited by Aussiebear; 04-11-2023 at 03:52 PM. Reason: Adjusted the code tags
Thanks for the reply.
Thats not actually what i'm trying to do though.
I need to change the status of the workbook from or to Read-Only.
Somewhere in the dark and nasty regions where nobody goes, stands an ancient castle.
Deep within this dank and uninviting place lives Berk, overworked servant of The Thing Upstairs.
But thats nothing compared to the horrors that lurk beneath The Trap Door.