{"id":3299,"date":"2021-05-01T09:10:07","date_gmt":"2021-05-01T16:10:07","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3299"},"modified":"2021-05-01T09:10:09","modified_gmt":"2021-05-01T16:10:09","slug":"how-to-protect-power-queries-in-excel","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3299","title":{"rendered":"How to Protect Power Queries in Excel?"},"content":{"rendered":"\n<p>Following are the STEPS ;<\/p>\n\n\n\n<p>We take advantage of&nbsp;Protection Structure&nbsp;in Excel. This is where the magic begins, follow carefully:<\/p>\n\n\n\n<p>1. Stay in the Excel&nbsp;<strong>File<\/strong>&nbsp;and go to&nbsp;<strong>Review Tab<\/strong><br>Note: (Excel and not Power Query)<\/p>\n\n\n\n<p>2. Choose&nbsp;Protect Workbook<\/p>\n\n\n\n<p>3. Ensure the Structure box is ticked<\/p>\n\n\n\n<p>4. Provide a Password (optional)<\/p>\n\n\n\n<p>5. Confirm by re-entering ( if password is supplied)<\/p>\n\n\n\n<p>This not only restricts access to queries but also stop any further way to get into the editor. The query tab in the Ribbon is greyed out and you so is the option to edit under Get Data. Below are two images showing the same.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/excelinexcel.in\/ms-excel\/wp-content\/uploads\/sites\/2\/2020\/04\/Power-Query-Lock-1024x133.png\" alt=\"Power Query Locked\" class=\"wp-image-11790\" title=\"Protect Power Query in Excel 1\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/excelinexcel.in\/ms-excel\/wp-content\/uploads\/sites\/2\/2020\/04\/Power-Query-editor-lock.png\" alt=\"Protect Power Query\" class=\"wp-image-11791\" title=\"Protect Power Query in Excel 2\"\/><\/figure>\n\n\n\n<p><strong>NOTE<\/strong><\/p>\n\n\n\n<p>Locking the workbook structure also locks the ability to slip into Power Pivot.<\/p>\n\n\n\n<p>Another obstacle is that your&nbsp;structure of the workbook is locked, meaning you can not add, delete, or make any further structural changes to your file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Does doing a Refresh work when you Protect Power Queries?<\/strong><\/h2>\n\n\n\n<p>This is another set back!!<\/p>\n\n\n\n<p>In case you use Power Pivot the answer sadly is no, else refresh works completely alright. Furthermore, when all your tables are on worksheets or as connections, the refresh works just fine.<br>If you have a single Power Query that lands in the data model, you are jammed. If Power Pivot is involved and you have protected Queries using the above method, then refresh fails.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Is there another trick ?<\/strong><\/h2>\n\n\n\n<p>Yes certainly, but not very effective.<br>Firstly carry out the steps like you normally do or wish to in Power Query.<br>Once you click OK, load the data as a table onto a sheet.<br>Click anywhere within that table (to stay within the table)<\/p>\n\n\n\n<p>And then create a new Table by Click on:&nbsp;<strong>Data<\/strong>&nbsp;&gt;&nbsp;<strong>From<\/strong>&nbsp;<strong>Table<\/strong>.<\/p>\n\n\n\n<p><strong>What outcome is observed from the above steps and<br>Why is there a need to create another table?<\/strong><\/p>\n\n\n\n<p>The above steps enable us to makes a new query based on the initial query you made.<br>The difference is that in the new&nbsp;Table, there is only one step, which is the \u201cSource\u201d step.<br>Any updates to the original query will reflect on the second (New) one when you press \u201cRefresh\u201d.<br>And there you get a table not protected but your queries aren\u2019t visible in the sheet anymore.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following are the STEPS ; We take advantage of&nbsp;Protection Structure&nbsp;in Excel. This is where the magic begins, follow carefully: 1. Stay in the Excel&nbsp;File&nbsp;and go to&nbsp;Review TabNote: (Excel and not Power Query) 2. Choose&nbsp;Protect Workbook 3. Ensure the Structure box is ticked 4. Provide a Password (optional) 5. Confirm by re-entering ( if password is <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=3299\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,18],"tags":[707,708],"class_list":["post-3299","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-microsoft-office","tag-protect-power-queries","tag-protect-power-query"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3299"}],"version-history":[{"count":2,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3299\/revisions"}],"predecessor-version":[{"id":3301,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3299\/revisions\/3301"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}