I have a problem with my macro which is failed on attempt to UnfreezePanes. The document has structure protection: View > Protect Workbook > Structure and windows protection (for 2013 version)
In excel versions before 2013 I do not have problems with the macro:
Sub Unfreeze()
ActiveWorkbook.Unprotect
ActiveWindow.FreezePanes = False
End Sub
But in 2013 version I faced a problem when 'ActiveWorkbook.Unprotect' is executed without errors but does not cancel structure change restrictions from the document because the newt row ActiveWindow.FreezePanes = False
throws :
error 1004 'Application-defined or object-definited error'.
Moreover FreezePanes button on the Ribbon is locked even after pressing the button 'Enable Editing' which popups each time when I open the document.
After pressing the button 'Enable editing' I go to VBE and execute 'ActiveWorkbook.Unprotect' and then I still see the document is protected: View > Protect Workbook > Structure is checked. So my attempts to remove the protection not directly from this window are failed. But! I am not able to remove the protection even from this window! When I uncheck the checkbox 'Structure' the button [Ok] becomes unavaileble! The protection does not have a password because even when I type some symbols in the password field a still unable to press [Ok] button while 'Structure' checkbox is unchecked.
Please note the problem is reproducible in excel 2013 and it will be great if you advice how to unlock the document using vba code.