I have recently started using macros in excel as I wanted to streamline some of my business. I have created a word template that is a generic proposal document for my business. I am now trying to create a macro in my excel document that will automatically create a new word document from my template and populate some of the areas. I have managed to create the word document and get some of the text replaced with values from my excel document. I can not, however, automatically import a table into the document. I have followed online tutorials and adapted the macro as best I can but I can not get any further. The macro does not through up any faults when it runs and will complete. However, it just does not import the table over at all no matter what I change. I have tried to make it import based on Paragraph location, Page location and bookmark location and nothing seems to work.
Bellow is the macro that I am currently running:
Dim wApp As Word.Application Dim wDoc As Word.Document Dim tbl As Excel.Range Dim WordTable As Word.Table Set wApp = CreateObject("Word.Application") wApp.Visible = True
'create new proposal document Set wDoc = wApp.Documents.Add(Template:="C:\Users\Edward Baker\Documents\Custom Office Templates\Baiceir - Proposal Template2.dotx", NewTemplate:=False, DocumentType:=0)