title: System.Data.OleDB.OleDBExeption (0x80004005): Failure Creating File when trying to access .xlsx file from SharePoint
body: <p>I'm asking this question before I know the complete answer for the sake of the community. Feel free to chime in with suggestions etc.</p>
  
  <p><strong>The Scenario:</strong></p>
  
  <p>I'm working to create automated tests for a client. They wanted these tests to use a data source, but wanted them to be updated by manual testers and non-programming staff if possible. The solution we landed on involves having a spreadsheet located on a SharePoint site with the connection string specified in app.config. The software also determines what test settings are being used inside Microsoft Test Manager (or if it's being debugged/run locally) and uses that information to decide which sheets/rows it needs. This solution worked flawlessly locally.</p>
  
  <p><strong>The Problem:</strong></p>
  
  <p>We pushed a new build and associated our test cases with the solution. I attempted to run the tests from MTM. The tests initially failed because the Test Agent did not have excel or the data driver connectivity pack installed. I fixed this problem and was presented with what you see in the title:</p>
  
  <p>"System.Data.OleDB.OleDBExeption (0x80004005): Failure Creating File"</p>
  
  <p>This was a ridiculous error because a) we never create an excel file or even write to it b) we never encountered this error when running locally, and the account used by the test agent had the same sharepoint permissions. It should be noted that the Test Agent is a VM running Server 2012.</p>
  
  <p>Here are some clues that something was amiss:</p>
  
  <ul>
  <li>I could view the SharePoint site and even download the test data .xlsx file using Internet Explorer when remoting into the Test Agent. </li>
  <li>However I couldn't open the SharePoint site with Windows Explorer. I got the error "We're having a problem opening this location in File Explorer. Add this web site to your Trusted Sites list and try again". This error persisted, even after adding the site to Trusted Sites, and making sure the server was up-to-date with patches (There's some KB articles out there detailing this problem)</li>
  <li>I also couldn't map a network drive to the SharePoint site like I had on my dev machine</li>
  </ul>
  
  <p>Finally I tried something I should have much earlier. I changed the connection string in app.config to a local file location (something like "C:/Folder/TestData.xlsx"), queued a new build, downloaded the test data from SharePoint, and put it in that location on the Test Agent. The result was that the tests executed correctly using this local file.</p>
  
  <p>If someone knows how this AD account can be an Owner of a SharePoint site, but can't access it through Windows Explorer, please provide an answer below and you'll get some SO Karma. Otherwise I'll respond once I solve the problem.</p>