I have a workbook (located on my local drive) with a rather simple macro setup that unlocks a sheet upon the workbook opening, refreshes the data, then locks the sheet again. The sheet it unlocks is called "SignSheet" and it refreshes the data from a workbook called "signsheet" on another network drive.
This Workbook
Private Sub Workbook_Open()
RefreshData
End Sub
Macro
Sub RefreshData()
'
' RefreshData Macro
'
Application.ScreenUpdating = False
Sheets("SignSheet").Unprotect Password:="Password"
ActiveWorkbook.Connections("signsheet").Refresh
Sheets("SignSheet").Protect _
Password:="Password", _
UserInterfaceOnly:=True, _
AllowFiltering:=True, _
AllowSorting:=True, _
AllowUsingPivotTables:=True
End Sub
This works flawlessly until I tried to copy the workbook to another shared drive where other users could have access. The next day when I opened it, I received a message saying "You cannot refresh data from a protected table or sheet, please unprotect ...", so why is the macro no longer telling the sheet to unprotect itself upon opening the workbook. It worked perfect before copying it over to a network drive ... what changed?
I'm a newbie at this, so sorry if this is a simple answer ... but I couldn't find anything on the boards about this. Thanks.
This Workbook
Private Sub Workbook_Open()
RefreshData
End Sub
Macro
Sub RefreshData()
'
' RefreshData Macro
'
Application.ScreenUpdating = False
Sheets("SignSheet").Unprotect Password:="Password"
ActiveWorkbook.Connections("signsheet").Refresh
Sheets("SignSheet").Protect _
Password:="Password", _
UserInterfaceOnly:=True, _
AllowFiltering:=True, _
AllowSorting:=True, _
AllowUsingPivotTables:=True
End Sub
This works flawlessly until I tried to copy the workbook to another shared drive where other users could have access. The next day when I opened it, I received a message saying "You cannot refresh data from a protected table or sheet, please unprotect ...", so why is the macro no longer telling the sheet to unprotect itself upon opening the workbook. It worked perfect before copying it over to a network drive ... what changed?
I'm a newbie at this, so sorry if this is a simple answer ... but I couldn't find anything on the boards about this. Thanks.