title: Increasing speed of copying into Word from Excel and saving document
body: <p>I have some code that loops through rows, finds a desired area to copy, copies it to Word and then saves it as a "txt" file.  It works fine but is rather slow when running on full size samples where it is creating 80+ files.  I believe this is because the code below is opening and closing Word every time it runs rather than leave it open but I'm not sure how to get it to stay open and create new documents.  Is there a way to do that or another way to speed the code up?</p>
  
  <pre><code>Set wrdapp = CreateObject("Word.Application")
  wrdapp.Visible = False
  
  Set wrddoc = wrdapp.Documents.Add
  Rows(endingrow + 1).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
  Cells(endingrow + 1, "A").Value = "%"
  Rows(startingrow).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
  Cells(startingrow, "A").Value = "%"
  endingrow = endingrow + 2
  Range(Cells(startingrow, "A"), Cells(endingrow, "A")).Copy
  
  With wrdapp
  .Selection.PasteAndFormat (wdFormatPlainText)
  .Visible = True
  .Selection.WholeStory
  End With
  
  With wrdapp.Selection.ParagraphFormat
      .SpaceBefore = 0
      .SpaceBeforeAuto = False
      .SpaceAfter = 0
      .SpaceAfterAuto = False
      .LineUnitBefore = 0
  End With
  
  wrdapp.ChangeFileOpenDirectory GetFolder
  wrdapp.ActiveDocument.SaveAs2 filename:=filename, FileFormat:= _
  wdFormatText, LockComments:=False, Password:="", AddToRecentFiles _
  :=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
  :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
  SaveAsAOCELetter:=False
  wrdapp.Quit
  </code></pre>