title: Intermittent Excel Error when Opening/Saving Files
body: <p>For quite some time we've had an intermittent error crop up when saving/opening excel files (and only excel files) through automation in VBA. This error has been very unpredictable and occurs at different parts of our automation, but it seems to occur when saving/opening various files (and most often with random temporary files). We are currently using office 2010 and our systems are up to date. </p>
  
  <p>The error is: ”‘FILENAME.filetype’ cannot be accessed. The file may be corrupted, located on a server that is not responding, or read-only”. The filename in which this error occurs is always different (Example: 'A1B2CDE3.tmp'). The file in which the error occurs most frequently appears to be the randomly named temporary file that Windows generates when saving a workbook.</p>
  
  <p>Currently, we cancel out of this message box and the automation resumes as it normally would unless the same error occurs again later in the automation. </p>
  
  <p>Example Code in which the error frequently occurs:</p>
  
  <pre><code>WorkbookName.Sheets("Sheet1").Cells.NumberFormat = "General"
  
  ***WorkbookName.SaveAs FileName:=MyDirectory &amp; "\Filename.txt", FileFormat:=xlTextWindows***
  
  WorkbookName.Close savechanges:=False
  </code></pre>
  
  <p>Note: The bolded (***) portion of the above code is where the error most often occurs. The error does not occur because of the .txt file in the above example, it occurs because of the Windows generated temporary file when the txt file is saved. </p>
  
  <p>So far we have tried the following:</p>
  
  <p>•   Modifying VBA code (such as changing the saveas file type and automation to bypass the error message)</p>
  
  <p>•   Ensuring files are not read-only.</p>
  
  <p>•   Re-installing office on client machines.</p>
  
  <p>•   Checking permissions are correctly set on the shared drive and all files/folders.</p>
  
  <p>•   Removing latest office update on some client machines for testing.</p>
  
  <p>Although the error is occurring in excel, we believe that this may be a server related issue based on other forum discussions we have read where others were experiencing a similar issue.</p>
  
  <p>Any ideas are welcome at this stage, as we have been unsuccessful in resolving this issue.</p>