• Hot Topics

Excel Duplicate open word document before making changes - VBA

Hi everyone! I?m trying to finish off a sub routine but I?m facing a small issue. The code tries to open a given file (word template) through a dialog box. However I need to duplicate this Word document so that I do not lost the initial template. I would simply like to have the code applied to the duplicate and not the initial template. Below is the code: ----------------------------------------------------------------- Sub report() Application.DisplayAlerts = False Application.ScreenUpdating = False Dim WordApp As Word.Application Dim report As Word.Document Dim FileToOpen As Variant Set WordApp = CreateObject("Word.Application") WordApp.Visible = True FileToOpen = Application.GetOpenFilename(Title:="Please select a Word file to open", FileFilter:="Word Files (*.doc;*.docx),*.doc;*.docx") If FileToOpen = False Then MsgBox "No File selected!"

This question generated 11 answers. To proceed to the answers, click here.

This thread is current as of April 18, 2015.

For more resources for Microsoft Excel:

This article includes the following tags:

  • Excel
  • Microsoft Excel