title: How to save the file that is being opened?
body: <p>I have a macro that works for one particular file.</p>
  
  <p>How can I make it work for all my files? Specifically how do I change the name of the file so that it saves the file that is being opened?</p>
  
  <pre class="lang-vb prettyprint-override"><code>Sub Macro1()
  '
  ' Macro1 Macro
  '
  ' Keyboard Shortcut: Ctrl+m
  '
      Range("A:A,B:B").Select
      Range("B1").Activate
      ActiveSheet.Shapes.AddChart.Select
      ActiveChart.ChartType = xlLineStacked
      ActiveChart.SetSourceData Source:=Range( _
          "'cwapp5_MemCPU-Date-Mem'!$A:$A,'cwapp5_MemCPU-Date-Mem'!$B:$B")
      ChDir "D:\WayneCSV"
      ActiveWorkbook.SaveAs Filename:="D:\WayneCSV\cwapp5_MemCPU-Date-Mem.xlsx", _
          FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
  End Sub
  </code></pre>