title: IE 11/Office.js: Access is Denied trying to use localStorage
body: <p>If I try to run this code in my office-js add-in in Excel 2016 (Desktop), it throws an error and says Access is denied.</p>
  
  <pre><code>ngOnInit() {
      console.log('Writing to localStorage...' );
      localStorage.setItem('foo', 'bar');
      console.log('done.');
  }
  </code></pre>
  
  <p>However, <strong>this only happens on one computer, but works as expected on every other</strong>. Also, this code works perfectly fine running in any browser including IE 11. Further, if I run excel in Administrator mode, it also works as expected.</p>
  
  <p>There is some permissions or something that are off, writing to localStorage in Excel's sandboxed instance of IE11, and I can't figure out where or what it is.</p>
  
  <p>I think I have tried every fix on this related question and none of them seem to make a difference in this case (<a href="https://stackoverflow.com/questions/13102116/access-denied-for-localstorage-in-ie10">Access Denied for localstorage in IE10</a>).</p>
  
  <p><strong>More Background:</strong>
  Initially, this worked on my computer (and I was trying to fix it for a co-worker), but I changed my CachePath registry key (as noted here: <a href="https://stackoverflow.com/questions/13102116/access-denied-for-localstorage-in-ie10">Access Denied for localstorage in IE10</a>) to Local instead of LocalLow to be able to reproduce the bug on my box. However, after trying various things to fix it, even switching that registry key back to LocalLow doesn't resolve the issue on my box as I would've expected.</p>
  
  <hr>
  
  <p><strong>Update:</strong>
  Image of my CachePath registry key:<a href="https://i.stack.imgur.com/JVNL3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JVNL3.png" alt="CachePath is set to LocalLow"></a></p>
  
  <p>However, using process monitor, I can see it's using the wrong path and ignoring the registry key update:
  <a href="https://i.stack.imgur.com/bUd6V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bUd6V.png" alt="Actually using DomStore in Local instead of LocalLow"></a></p>
  
  <p>Why is it ignoring my registry update?</p>
  
  <hr>
  
  <p>Any ideas?</p>