LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Report Uprotect not working

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: 

 

tux1972_0-1732304666859.png

I got this error, in english it will sound like Old format or type library not valid .. 

 

Any hint?

 

Best regards,

 Mike

0 Kudos
Message 1 of 5
(98 Views)

Please note that using Excel or code based on OpenXML API allow the protection lock to be removed without problems.

0 Kudos
Message 2 of 5
(91 Views)

Does the Workbook -> Protect(Unprotect) method work? 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 5
(60 Views)

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.

0 Kudos
Message 4 of 5
(43 Views)

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.

tux1972_1-1732349376457.png

0 Kudos
Message 5 of 5
(30 Views)