RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 810
- Office Version
- 365
- Platform
- Windows
Hi guys, having a small problem with this.
Looking to open a workbook, unprotect it and unhide hidden rows.
It can't unhide the hidden rows because the workbook stays protected, even after successfully skipping over activeworkbook.unprotect. I've also tried newbook.unprotect, and tried putting password in brackets, etc etc.
Looking to open a workbook, unprotect it and unhide hidden rows.
VBA Code:
Set newbook = Workbooks.Open(Filename:=selectedFile, ReadOnly:=True)
DoEvents
ActiveWorkbook.Unprotect Password:="louise"
Set ss = Worksheets("Summary Sheet")
' Unhide all rows, columns & remove filters
On Error Resume Next
If ss.AutoFilterMode Then
ss.AutoFilterMode = False
End If
ss.Cells.EntireRow.Hidden = False
ss.Cells.EntireColumn.Hidden = False
On Error GoTo 0
It can't unhide the hidden rows because the workbook stays protected, even after successfully skipping over activeworkbook.unprotect. I've also tried newbook.unprotect, and tried putting password in brackets, etc etc.