Supporting the above post I submit code for Sheet Lock & Unlock - using a blank password for Excel 2013, or other password for any earlier version.
The code is designed to only use a blank password if current Excel Version is 2013, otherwise a VBA constant value is used.
Place the following code into a new module:
'-----------------start module code----------------------
Public Const GLOBALPASSWORD = "MyPassword"
Public Sub ProtectSheet(theSheet As Worksheet)
' Procedure to Protect a worksheet - Excel 2013 friendly
' Lean Software Ltd : http://leansoftware.net
' If Excel 2013 or greater use blank password to avoid performance issues
With theSheet
.Activate
If Not .ProtectContents Then
If Application.Version >= 15 Then ' Excel 2013 or above
.Protect Password:="", userInterfaceOnly:=True, Contents:=True
Else
.Protect Password:=GLOBALPASSWORD, userInterfaceOnly:=True, Contents:=True
End If
.EnableSelection = xlUnlockedCells
End If
End With
End Sub
Public Sub UnProtectSheet(theSheet As Worksheet)
' Procedure to UnProtect a worksheet - Excel 2013 friendly
' Lean Software Ltd : http://leansoftware.net
' If unlock fails - try unlock with blank password : see routine above 'ProtectSheet'
With theSheet
.Activate
If .ProtectContents Then
On Error GoTo TryBlankPassword
.Unprotect (GLOBALPASSWORD)
GoTo Continue
TryBlankPassword:
.Unprotect ""
Continue:
End If
End With
On Error GoTo 0
End Sub
'-----------------end module code----------------------
Example unlock a sheet :
UnProtectSheet Worksheets("SheetName")
Lock sheet example:
ProtectSheet Worksheets("SheetName")
To prevent any other user saving the workbook; place this code into the Workbook code:
' -------------Workbook code -----
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' Replace "!Developer name!" with your user name
If Environ("username") <> "!Developer name!" Then
MsgBox "Only " + Environ("username") + " can modify this workbook"
Cancel = True
End Sub
' -------------End Workbook code -----
One hopes an alternative will be released by Microsoft - but at least this is one workaround to try.
Cheers