https://bugs.documentfoundation.org/show_bug.cgi?id=140485
--- Comment #2 from An-Kh <[email protected]> ---
(In reply to Uwe Auer from comment #1)
> The problem is with
>
> > If IsMissing(pPassword) Then pPassword = "SomePassword"
>
> which does not set the password pPassword to "SomePassword". Runtime
> function "IsMissing" tests if a function is called with an _optional_
> parameter and function "LockSheet" has no optional parameter. called
> pPassword. Therefore pPassword stays empty and protection is activated with
> an "empty" password. Change the code to something like:
>
> >Sub LockThisSheet
> > LockSheet("Sheet1")
> >End Sub
> >
> >Function LockSheet(passedSheetname, optional pPassword )
> >
> > Dim oDoc As Object : oDoc = ThisComponent
> > Dim oSheet As Object : oSheet =
> > oDoc.Sheets.getByName(passedSheetname)
> >
> > If IsMissing(pPassword) Then pPassword = "SomePassword"
I think that in this line it says that if the pPassword is missing set the
pPassword to "SomePassword". Since here pPassword is missing, pPassword is set
to "SomePassword".
> > oSheet.UnProtect(pPassword)
> > oSheet.Protect(pPassword)
Here it protects the sheet with pPassword
> >
> >End Function
>
> From my perspective not a bug
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs