using Infragistics.Documents.Excel;
Using C:\Program Files (x86)\Infragistics\2015.1\Windows Forms\CLR4.0\Bin\Infragistics4.Win.UltraWinGrid.DocumentExport.v15.1.dll
I have a template file (.xlsx) - I open it everything is unprotected. I update some of the data in formulas.
I go book.Save(); and when I re-open the worksheets are all protected.
I don't want any protection!
I checked book.Protected and book.Worksheets[0].Protected and everything is false!
I then Close and re-open the book and it is shown as Protected = false again.
I open in Excel 2013 and it shows as sheets are protected. Why is that?See attachment - open file in Excel 2013 and hit File and see that the sheets are protected. open up the same file via:
FileStream stream = File.OpenRead(sFileName); Workbook book = Workbook.Load(stream); stream.Close();
Check book.IsProtected and book.Worksheets[0].IsProtectedThe sheets are proected in Excel 2013 but unprotected in Infragistics - what is up - how do I unprotect???
Original template prior to going through Infragistics is unprotected...
How do I make Excel realize that there is no protection?
Hi Haessd,
When you open your template in order to edit the data, did you try calling Workbook.Unprotect() before saving it? You shouldn't need to do this if the workbook was already unprotected before you opened it but it seems that editing your workbook is causing this to happen so it wouldn't hurt to call Unprotect().
I tested this by creating my own xlsx file and then opening it with the Infragistics Excel framework. I changed a value inside the workbook and then saved it back. It did not open in Excel as a protected file so I'm not really sure why you see this occur. Try calling Unprotect() and let me know how that turns out.
I did this before writing into the forum...
book.Unprotect(); inboundSheet.Unprotect(); outboundSheet.Unprotect(); book.RecalculateBeforeSave = true; book.Save(sTempForm);
I also tried
book.Protect(); inboundSheet.Protect(); outboundSheet.Protect();
before unprotecting to be on the safe side of trying to turn off protection.
The service releases are available on the My Keys and Downloads page. They can be found on the Service Releases tab after you select the product that you want to see downloads for. If you re-run the installer, there is an option to install updates that will also automatically get the latest service release and install it.
The download I have is from June or July (after May) because out license wasn't renewed until June.
My download doesn't work. Is there a download past my download - do I just re-download the Vol 1 of 2015 ultimate and install like I did in June/July or is there another place to pick up the latest patches.
I spoke to our devs about this and there was a bug fix made back in May that should help you resolve this issue. If you download the latest service release you will get the fix. Your other option is to call Protect() on the workbook passing in false for the allowEditObjects and AllowEditScenarios flags, then call Unprotect().
As for why the book.IsProtected flag shows up as false even though the workbook is protected, this is an existing bug where we are not considering worksheets to be protected if the allow edit scenarios or object flags are true. When we load up your protected xlsx file, the IsProtected property should be showing true.
Since we've already logged this as a bug I created a private support case for you so that you can track the status of it. The bug ID is 206853 and your case number is CAS-164325-R9Y9V4. You can view it here.