title: Excel VBA Check if directory exists error
body: <p>I have a spreadsheet that upon clicking a button will duplicate itself by copying/pasting everything to a new workbook and save the file with a name that is dependent upon some variable values (taken from cells on the spreadsheet).
  My current goal is to get it to save the sheet in different folders depending on the name of client name (cell value held in variable), while this works on the first run, I get an error after.</p>
  
  <p>The code checks if the directory exists and creates it if not.
  This works, but after it is created, running it a second time throws the error:</p>
  
  <blockquote>
    <p>Runtime Error 75 - path/file access error.</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>Sub Pastefile()
  
  Dim client As String
  Dim site As String
  Dim screeningdate As Date
  screeningdate = Range("b7").Value
  Dim screeningdate_text As String
  screeningdate_text = Format$(screeningdate, "yyyy\-mm\-dd")
  client = Range("B3").Value
  site = Range("B23").Value
  
  Dim SrceFile
  Dim DestFile
  
  If Dir("C:\2013 Recieved Schedules" &amp; "\" &amp; client) = Empty Then
      MkDir "C:\2013 Recieved Schedules" &amp; "\" &amp; client
  End If
  
  SrceFile = "C:\2013 Recieved Schedules\schedule template.xlsx"
  DestFile = "C:\2013 Recieved Schedules\" &amp; client &amp; "\" &amp; client &amp; " " &amp; site &amp; " " &amp; screeningdate_text &amp; ".xlsx"
  
  FileCopy SrceFile, DestFile
  
  Range("A1:I37").Select
  Selection.Copy
  Workbooks.Open Filename:= _
      "C:\2013 Recieved Schedules\" &amp; client &amp; "\" &amp; client &amp; " " &amp; site &amp; " " &amp; screeningdate_text &amp; ".xlsx", UpdateLinks:= _
      0
  Range("A1:I37").PasteSpecial Paste:=xlPasteValues
  Range("C6").Select
  Application.CutCopyMode = False
  ActiveWorkbook.Save
  ActiveWindow.Close
  
  End Sub
  </code></pre>
  
  <p>You'll have to excuse my lack of knowledge in this area, I am still learning.
  I have a very strong feeling it has something to do with the directory checking logic, as when the error is thrown the <code>MkDir</code> line is highlighted.</p>