I’ve created a spreadsheet in Excel 2016 that has an Excel Query to a SQL database configured on a hidden sheet. The query to set to refresh when the file is open. While the file is being opened, Excel “selects” the query result cells on the hidden sheet during the refresh. The sheet remains hidden (not visible and no tab at the bottom), but somehow has the focus. You can see this in the screenshoot when the shading (the selected cells) does not correspond with the cells on the visible sheet. While this supposedly “hidden” sheet has the focus it is possible to interact with it, including adding or deleting data (or the entire query!). Clicking on one of the tabs at the bottom of the screen returns the focus to that tab and the hidden sheets are no longer accessible.
I’ve tried protecting the hidden sheet, but that blocks the query from refreshing when the file is opened.
Any thoughts on how to properly protect my query from accidental deletion?