PDA

View Full Version : Excel data to Word template



Birch81
02-20-2011, 02:20 PM
Hey,

I have a little problem opening a Word template. well not opening it but when I send data from a Excel template to the Word template I want word to create a new word document as a result of the template.
Ect. if the template is called template then when I am sending data to the word document a document called template1 is opening.

This is how I open the document. But when I do it this way the actual template is opened.

Set appWord = CreateObject("Word.application")
Set appDoc = appWord.Documents.Open(Filename:=ThisWorkbook.Path & "\Tilbudsskabelon - Ren investeringsbidrag.dotx")
appWord.Visible = True

Does anyone know how to do this? :think:

Shred Dude
02-20-2011, 03:10 PM
Try:
Set appDoc = appWord.Documents.Add(Filename:=ThisWorkbook.Path & "\Tilbudsskabelon - Ren investeringsbidrag.dotx")

Birch81
02-21-2011, 12:27 AM
Thank you very much. :hi: