From code:
Option Explicit
Sub LockThisSheet
LockSheet("Sheet1")
End Sub
Function LockSheet(passedSheetname)
Dim oDoc As Object : oDoc = ThisComponent
Dim oSheet As Object : oSheet = oDoc.Sheets.getByName(passedSheetname)
Dim pPassword As String
If IsMissing(pPassword) Then pPassword = ""
oSheet.UnProtect(pPassword)
oSheet.Protect(pPassword)
End Function
Why does the icon not appear in front of sheet name ?
On the other hand, it will show after moving such sheet.
[ Fedora 32 Workstation Cinnamon Desktop Spin ] [ LibreOffice 6.2.8.2-2 ]