title: Using Excel to Save a Word File With Name
body: <p>I have a Word template which I am using with &lt; amount >, &lt; account > etc. which I am then having a VBA script in Excel pull data from cells and replace the &lt; amount > etc. with the value in the cell.</p>
  
  <p>I've got it working fantastically now but I am having some troubles with saving the Word document. Essentially I am wanting to have the Excel script pull the name for the document from a cell and then save the document with that as its name in a different location as to not save over the template.</p>
  
  <p>Essentially my goal is to fill data into a handful of cells and then trigger a VBA script which replaces text on the Word document template and then saves the document with a particular name.</p>
  
  <p>I've attempted the answers from a similar question here <a href="https://stackoverflow.com/questions/26042519/excel-vba-to-open-word-template-populate-then-save-as-docx-file-somewhere-els">Excel VBA to open word template, populate, then save as .docx file somewhere else</a> but it isn't working within my code.</p>
  
  <p>Here's the existing code so far:</p>
  
  <pre><code>Option Explicit
  
  Public Sub WordFindAndReplace()
  Dim ws As Worksheet, msWord As Object
  
  Set ws = ActiveSheet
  Set msWord = CreateObject("Word.Application")
  
  With msWord
  .Visible = True
  .Documents.Open "/Users/Aafrika/Desktop/Test.docx"
  .Activate
  
  With .ActiveDocument.Content.Find
      .ClearFormatting
      .Replacement.ClearFormatting
  
      .Text = "&lt;date&gt;"
      .Replacement.Text = Format(ws.Range("C1").Value2, "dd/mm/yyyy")
  
      .Forward = True
      .Wrap = 1               'wdFindContinue (WdFindWrap Enumeration)
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  
      .Execute Replace:=2     'wdReplaceAll (WdReplace Enumeration)
  
      .Text = "&lt;amount&gt;"
      .Replacement.Text = Format(ws.Range("C2").Value2, "currency")
  
      .Forward = True
      .Wrap = 1               'wdFindContinue (WdFindWrap Enumeration)
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  
      .Execute Replace:=2     'wdReplaceAll (WdReplace Enumeration)
  
  
  End With
  .Quit SaveChanges:=True
  End With
  End Sub
  </code></pre>
  
  <p>Any ideas on how to get this to work would be great. Thanks in advance!</p>