Forum Discussion
Can no longer refresh data in a Protected Workbook since Excel version 1803
Seems to have been a functionality change introduced in version 1803.
We have a protected workbook with some data connections to pull in data from SQL. Since updating to version 1803 the message 'Workbook is protected and cannot be changed' appears when trying to refresh the data. Removing workbook protection allows data to be refreshed.
Using the same workbook in version 1802 allows the data to be refreshed with the workbook protection left on.
Posting here in case anyone else experiences this issue.
Hi there,
The fix was deployed for the following Office versions:
- Version 1803 (Build 9126.2196) and later
- Version 1804 (Build 9226.2135) and later
- Version 1805 (Build 9330.2017) and later
Hope this helps.
Guy.
- Excel Team
67 Replies
- Inbar_Privman
Microsoft
JonSov Hi,
could you please send us the Excel version you are using (Link for how to find your Excel version) and describe to us the exact scenario that happened to you?
Inbar
Excel Team
- judremyCopper Contributor
I also have this issue in Excel. Version is Excel for Office 365 MSO (16.0.12527.21296) 64-bit. If you lock a worksheet and have a query table on it, the query cannot refresh. You also cannot allow that option as it isn't in the list of checkboxes when enabling Protect Worksheet.
- Miroslaw MagierskiCopper Contributor
Same problem here.
If it's a feature and not a bug (which I'm really hoping is not the case) then I'd like an option to not use it. I honestly can't see what benefit would there be to having it work like that.
- David BranderBrass Contributor
Above, Guy Hunkin suggested that it isn't a feature and the team is working on a fix. Guy - do you have any update?
Thanks,David
- Nicolaj Lefevre GrumstrupCopper Contributor
The problem seems to be solved now. I don't get the pop-up anymore when I open the workbook.
Is it the same for you?
Kind regards
Nicolaj
- Nicolaj Lefevre GrumstrupCopper Contributor
I have the exact same problem.
I hope a solution will be found soon.
- Guy Hunkin
Microsoft
Hi,
It is a known regression and we are working on a fix. Stay tuned and follow up the updates on Tech Community.
Guy
- Excel Team- iriswCopper Contributor
Guy Hunkin I just tried doing this in my excel sheet right now 5/4/2019 and it still doesn't work. Once I protect my worksheet, it no longer allows me to refresh.
- Guy Hunkin
Microsoft
irisw ,
Please provide more details about your Excel version and your exact scenario.
Guy
- Excel Team
- David BranderBrass Contributor
Thank you Guy! :) Please keep us updated.
David
Guy Hunkin wrote:Hi,
It is a known regression and we are working in a fix. Stay tuned and follow up the updates on Tech Community.
Guy
- Excel Team- Alex LushIron Contributor
Guy Hunkin- many thanks for your update.
I did finally receive an update to the ticket I logged through O365, although the information directly contradicts what Guy has said in this thread!
[Ticket #:7973974]
Hello Alex,
This issue is by design and even Out of Support for Office 365 Technical Support.
You may share your valuable feedback for this on the below support links -
https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/32287204-enable-data-query-refresh-with-powerpivot-tables
https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/34126504-sql-queries-won-t-refresh-on-protected-workbook-si
Should you have any additional queries, please let me know.
Thanks
Ankit Shukla
Microsoft Office 365CwsRequestId:7438ad61-ee11-4d5f-a9de-af58cf7fa14a
- Jarrod KingCopper Contributor
This has created MAJOR issues for me. I have loads of protected models and reports that extract info via SQL that are business critical. Please microsoft, can you look at this this problem ASAP?
- Eirik G. JensenCopper Contributor
This is a major problem. Everybody vote this thread up and send complaint to Microsoft helpdesk.
Coded workbooks are usually used by a lot of people, and then suddenly production halts. Not fun.
A problem with the solution to open/close workbook:
If the code have to unprotect/protect for every data read, this takes time to run (since it decrypt/encrypt the workbook), making for a lesser user experience.
If this is intentional by Microsoft, at least there should be an option to toggle the new functionality of "protect workbook" on/off.
- David BranderBrass Contributor
I have this same issue, the only work around I've come up with so far is to use a macro to run when the workbook is opened, unprotect the workbook, refresh the data (not in the background) and then lock the workbook. It's a pain in the arse since I have to change many different tools. Please roll this change back!
- Andrew NevardCopper Contributor
Yes this is a big problem.
My query is refreshed using VBA. I use a class object for the query so it can run in the background and trigger events. My workaround is to use the BeforeRefresh event to unlock the workbook, and the AfterRefresh event to lock it again. I have not tried to see if these events are triggered when a user selects Refresh All from the data ribbon.
Of course I do have to update all the workbooks that I have deployed!
- Brian McKayCopper Contributor
Hey David,
Can you share your macro? I don't think it'd work for my situation but it might help others in the same pickle.
- David BranderBrass Contributor
Hi Brian,
Sure, happy to. I'm no Excel expert but put this together this afternoon. Use at your own risk.Add this to the workbook macro section:
Private Sub Workbook_Open() Call RefreshQuery End Sub
Add this to a module:
Sub RefreshQuery() ThisWorkbook.Unprotect strAdminPassword Application.EnableEvents = False 'This value check looks at a formula I have in the workbook. if you haven't refreshed within a week you get a 1 If Range("SECTOR!B33") = 1 Then StartTime = Time ' Show 'Updating..'-message Not sure if the timer is needed any more, it was legacy from something else but it works with it, so hey if it ain't broke... ActiveSheet.Shapes.Range(Array("Rectangle: Rounded Corners 1")).Visible = True nSec = 0.1 + Timer While nSec > Timer DoEvents Wend 'Change "Connection" to the connection name you have. ActiveWorkbook.Connections("Connection").Refresh ' Remove 'Updating..'-message ActiveSheet.Shapes.Range(Array("Rounded Rectangle 1")).Visible = False nSec = 0.1 + Timer While nSec > Timer DoEvents Wend End If 'This section below is more specific to my use case - so I track when this was last refreshed, if it's older than a week I'll force the user to refresh to continue to use the workbook. Dim cell As Range Dim rng As Range Dim RangeName As String Dim CellName As String 'Single Cell Reference (Workbook Scope) RangeName = "REFRESH_DATE" CellName = "O1" Set cell = Worksheets("UCON Pricing Tool (2016)").Range(CellName) ThisWorkbook.Names.Add Name:=RangeName, RefersTo:=cell Range("REFRESH_DATE").Value = Date Range("REFRESH_DATE").NumberFormat = "dd/mm/yyyy" Application.EnableEvents = True ThisWorkbook.Unprotect strAdminPassword End Sub
You may need to edit the code to get what you want from it, but it's a base. I am still testing this with my workbooks so it may not be final. Effectively, use at your own risk/understanding. It may work for you, it may not. Currently, it seems to work for me but it's a pain in the arse of a workaround.
You'll need to disable background refresh for your connection, and disable refresh on opening.
David
- Marcel PayensCopper Contributor
Same here, already cost me a full day of work to create workarounds. The workbook protection is an essential feature. Extremely poor performance of Microsoft.
- Brian McKayCopper Contributor
I'm having the same problem. It started on or about April 4, 2018.
I have a .xlsm file which has a data connection to a .csv sheet located in the same folder. The workbook is protected and will not pull the data from the CSV. I'm getting the same error message as everyone else. Removing the protection from the workbook allows the data to be pulled. The last time the file itself was modified was back in January. Hopefully this is a bug and will be fixed soon.
- Andrew NevardCopper Contributor
Yes same issue with webquery. I have a ton of clients that have started reporting issues with workbooks that have been deployed to them. Is there a workaround, besides unprotecting the workbook?
Help!