= Excel =

Discussion in 'Windows Desktop Systems' started by NLM, Apr 12, 2003.

  1. NLM

    NLM Guest

    How do I make a marco that transfers an excel file to word.
     
  2. Jewelzz

    Jewelzz OSNN Godlike Veteran

    Messages:
    10,977
    Location:
    California
    Moved to Applications

    Please only post your question in one forum.
     
  3. NLM

    NLM Guest

    got it

    Sub ControlWord()
    Dim appWD As Word.Application
    ' Create a new instance of Word & make it visible
    Set appWD = CreateObject("Word.Application.8")
    appWD.Visible = True

    Sheets("Game Counts").Select

    ' Copy the data for the new document to the clipboard
    Range("A1:k16").Copy
    ' Tell Word to create a new document
    appWD.Documents.Add
    ' Tell Word to paste the contents of the clipboard into the new document
    appWD.Selection.Paste
    ' Save the new document with a sequential file name
    appWD.ActiveDocument.SaveAs Filename:="Full Printout"
    ' Close this new word document
    'appWD.ActiveDocument.Close
    ' Close the Word application
    'appWD.Quit
    End Sub