G
GastonFranzini
Hi, I havesome trouble making ths excel macro work.
What I need to do is to open a word document that is uplodaded by it´s
linked data to the excel, then I need to save it and then print it.
The troubles are that it waits the application to finish when it
already finished and then the word asks me save normal.dot.
Thanks in advace for the help.
-----------------------------------------
Sub wordchage()
Dim WordApp As Object
Set WordApp = CreateObject("Word.Application")
fpath = ThisWorkbook.Path
doc = fpath & "\" & ("Base.doc")
Sheets("Incumbent").Select
LetterTemplate = doc
fname = Range("A3")
fnamedoc = fname & ".doc"
With WordApp
..Documents.Open LetterTemplate
..Visible = True
End With
fname = fname & ".pdf"
WordApp.ActiveDocument.PrintOut
WordApp.ActiveDocument.SaveAs Filename:=fpath & "\" & fnamedoc
WordApp.Quit
Set WordApp = Nothing
End Sub
What I need to do is to open a word document that is uplodaded by it´s
linked data to the excel, then I need to save it and then print it.
The troubles are that it waits the application to finish when it
already finished and then the word asks me save normal.dot.
Thanks in advace for the help.
-----------------------------------------
Sub wordchage()
Dim WordApp As Object
Set WordApp = CreateObject("Word.Application")
fpath = ThisWorkbook.Path
doc = fpath & "\" & ("Base.doc")
Sheets("Incumbent").Select
LetterTemplate = doc
fname = Range("A3")
fnamedoc = fname & ".doc"
With WordApp
..Documents.Open LetterTemplate
..Visible = True
End With
fname = fname & ".pdf"
WordApp.ActiveDocument.PrintOut
WordApp.ActiveDocument.SaveAs Filename:=fpath & "\" & fnamedoc
WordApp.Quit
Set WordApp = Nothing
End Sub