Hi,
I am having a hard time getting the below code to work.
[vba]
Private Sub Workbook_Open()
On Error Resume Next
ActiveSheet.Unprotect
ActiveWorkbook.RefreshAll
ActiveSheet.Protect
End Sub
[/vba]
When the workbook is last closed it is saved as a protected file. I need for it to open as an unprotected sheet so that it can import data. The code works well if the the below code line is removed:
[vba] ActiveSheet.Protect[/vba]
However, removing the above code leaves the worksheet unprotected. Any idea how to automatically protect the sheet after it refreshes?
Thanks in advance!