Pavertheway
New Member
- Joined
- Nov 5, 2018
- Messages
- 47
Hi,
I have the following code;
And in the ActiveWorkbook.Save I owuld only like this to happen if it is a local file, and if it is read only then it would not save. Is this possible?
Thanks!
I have the following code;
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)Dim ws As Worksheet
Sheets("START").Visible = xlSheetVisible
Application.EnableEvents = False
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "START" Then
ws.Visible = xlVeryHidden
End If
Next ws
ActiveWorkbook.Save
End Sub
And in the ActiveWorkbook.Save I owuld only like this to happen if it is a local file, and if it is read only then it would not save. Is this possible?
Thanks!