title: Excel VBA : Run Time Error 1004 : Excel cannot access to file
body: <p>I am creating a macro of the report generator that let the user to save a copy of the file to its destination.</p>
  
  <p>Cell value ("E5") is where the user input the date.
  Cell value ("E11") is where user keyin the record name (in this case colour values)</p>
  
  <p>The macro will save it to the location in the C drive </p>
  
  <p>Here are the code :</p>
  
  <pre><code>Sub CTemplate()
  
  'Select up the macro generator
      Sheets("File Generator").Select
  
  'Save file according to the textbox values
  
          Dim filename As String
          Dim varDatevalue As String
          Dim varColourvalue As String
  
          varDatevalue = Range("E5").Value
          varColourvalue = Range("E11").Value
  
          ActiveWorkbook.SaveAs filename:="C:\Colour Log\" &amp; varDatevalue &amp; "--" &amp; varColourvalue &amp; ".xlsm", _
          FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
  </code></pre>
  
  <p>However, there are some problems as I encounter to run time error:
  <a href="https://i.stack.imgur.com/TZREV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TZREV.png" alt="enter image description here"></a></p>
  
  <h2>I already tried as followed:</h2>
  
  <ul>
  <li>Debugging and search for SO but couldn't find any one else with the same problems</li>
  <li>I already created the folder at the desired locations</li>
  <li>Uncheck ("Read Only") check box for the file so it can be written</li>
  </ul>
  
  <p>Thank you .</p>