11-22-2024 01:50 PM - edited 11-22-2024 02:03 PM
I'm still experimenting with MS Report Toolkit password protection, this time I'm using LV 2024 Q3 32bit Community instead LabView 2013 SP1 I use in production.
I'm using MS Office 365 on both systems.
_Worksheet.Protect method works fine exactly as I expected (on both platforms).
Now is the time to unprotect the report file.
Since there's an _Worksheet.Unprotect method I tried it, but:
I got this error, in english it will sound like Old format or type library not valid ..
Any hint?
Best regards,
Mike
11-22-2024 01:58 PM
Please note that using Excel or code based on OpenXML API allow the protection lock to be removed without problems.
11-22-2024 04:04 PM
Does the Workbook -> Protect(Unprotect) method work?
11-23-2024 01:11 AM - edited 11-23-2024 01:34 AM
I need to check _Workbook.Unprotect but I even if it works it does not work the way I need:
_Worbook.Protect has the same effect of setting the password when using Save Report to File.vi and that's not what I need,
I don't really know what kind of safety it can add to a report as a matter of fact you can modify the file wheter you know the password or not and if you are malicious you just have to Save As and then rename the file overwriting the protected copy.
The correct behaviour for my use is that provided by _Worksheet.Protect.
11-23-2024 02:10 AM - edited 11-23-2024 02:11 AM
I found a way to fix the problem.
The key is to use the _Worksheet.Protect both for protecting and for unprotecting the sheet method changing the value of the parameters boolean flags.
I.e.