title: Excel VBA - File does not exist error message for remote users
body: <p>I have a an html page with a form where users can upload a .txt file to the server. They choose the file and press an upload button and the file gets uploaded to the website root folder via a PHP script. In this root folder is a .xlsm file that the user use to upload the file they uploaded into an MS SQL server database that runs queries and send the result back to the .xlsm file.</p>
  
  <p>The problem i have is that when a user upload the file, the temp file gets moved (with <code>move_uploaded_file</code> method) to the website root directory and that saved file gets uploaded to the database, but the user keep getting an error message that the file does not exist. When i copy the file manually from another directory to the root directory the user can upload the data to the database.<br>
  It is like the temp file gets moved to the root directory but does not make it available for use. Here is my code:</p>
  
  <p>Html: upload.html</p>
  
  <pre><code>&lt;html&gt;
  
      &lt;form enctype="multipart/form-data" action="upload.php" method="POST"&gt;
          &lt;input type="hidden" name="MAX_FILE_SIZE" /&gt;
          Choose a file to upload: &lt;input name="nfile" type="file" /&gt;&lt;br /&gt;
          &lt;input type="submit" value="Upload File" /&gt;
      &lt;/form&gt;
  
      &lt;br&gt;&lt;br&gt;
      &lt;a href='Lostsales.xlsm'&gt;Spreadsheet&lt;/a&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>PHP: php.html</p>
  
  <pre><code>&lt;?php
  
  $name = $_FILES["nfile"]["name"];
  $tmp_name = $_FILES["nfile"]["tmp_name"];
  
  move_uploaded_file($tmp_name, $name);
  
  echo $tmp_name;
  
  ?&gt;
  &lt;html&gt;
  &lt;form action="upload.html"&gt;
  &lt;input type="submit" value="Done" /&gt;
  &lt;/form&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>VBA code for uploading data to MS SQL database: Lostsales.xlsm</p>
  
  <pre class="lang-vb prettyprint-override"><code>Sub Button1_Click()
  
  
      Dim con As New ADODB.Connection
  
      con.Open "Provider=SQLOLEDB.1;Password=valencia;Persist Security Info=True;User ID=lostsls;Initial Catalog=Lost_sales;Data Source=PCS2635\SQLEXPRESS"
  
      con.Execute "BULK INSERT lsdata FROM '" &amp; Cells(7, 1).Value &amp; "' WITH(FIRSTROW = 2, FIELDTERMINATOR='\t' ,ROWTERMINATOR='\n')"
  
      con.Close
      Set con = Nothing
  
  
  End Sub
  </code></pre>
  
  <p><code>Cells(7, 1).Value</code> = <code>C:\inetpub\wwwroot\test\lostsls\import.txt</code></p>
  
  <p>Aparently when the remote user run the VBA macro, he/she gets the message that the file <code>C:\inetpub\wwwroot\test\lostsls\import.txt</code> does not exist. Where import.txt is the file the user uploaded in the HTML/PHP codes. And when I try it does get uploaded.</p>