title: Run-time error '1004' The file could not be accessed. Try one of the following:
body: <p>I am trying to save my workbook every 10 minutes but I keep getting the run time error 1004. The code shown is in one of the modules. My program will save my entire workbook as today's date into a folder. </p>
  
  <p>Everything was working perfectly fine until I ran the code and then saved it and now I get that error. </p>
  
  <pre><code>Sub CommandButton1_Click()
  Dim path As String
  Dim filename1 As String
  
  
  
  path = "C:\Users\100020427\Desktop\FPYFiles\"
  
  filename1 = ThisWorkbook.Sheets("Totals").Range("M10").Text
  Application.DisplayAlerts = False
  If ThisWorkbook.Name = filename1 Then
      ThisWorkbook.save
      MsgBox "Today's Form has been saved! Click Ok Button"
  Else
      ThisWorkbook.SaveAs Filename:=path &amp; filename1, FileFormat:=52, CreateBackup:=False
      MsgBox "Today's Form has been saved! Click Ok Button"
      Application.DisplayAlerts = True
  End If
  'Application.DisplayAlerts = False
  'ActiveWorkbook.save Filename:=path &amp; filename1, FileFormat:=52, CreateBackup:=False
  'Application.DisplayAlerts = True
  
  Application.OnTime Now + TimeValue("00:01:00"), "CommandButton1_Click"
  End Sub
  
  Sub Workbook_Open()
  CommandButton1_Click
  Application.OnTime Now + TimeValue("00:01:00"), "CommandButton1_Click"
  End Sub
  </code></pre>
  
  <p>I expect is to save workbook as the date in the listed location</p>
  
  <p><a href="https://i.stack.imgur.com/dOui9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dOui9.png" alt="enter image description here"></a></p>