Pull excel table into existing word template

LeeM55

New Member
Joined
Aug 10, 2019
Messages
2
I have a word template that already is set to execute a function by an application and create a new doc. I'd like to add a sub and pull in one table from one sheet in an existing excel wb. I understand how to set the reference for ws, how can I add a routine here that will pull in the table from the sheet? I've been doing it with an Excel Marco after I run the application template, but would like it all done at the same time.

Here is the existing function:

' Execute
Public Function Execute(POM As Object) As Long
On Error GoTo Execute_Error
Dim CurrDoc As Document
Dim Doc As Document

Set CurrDoc = ActiveDocument
Set Doc = Documents.Open(POM.Path & POM.Product.ID & "\Signatures.dot", , , True, , , , , , , , False)
Doc.Execute POM, CurrDoc, "Signatures", POM.FundingIndex(POM.RecID) + 1
Doc.Close wdDoNotSaveChanges

Set Doc = Documents.Open(POM.Path & POM.Product.ID & "\Signatures.dot", , , True, , , , , , , , False)
Doc.Execute POM, CurrDoc, "Signatures"
Doc.Close wdDoNotSaveChanges

Execute_Exit:
On Error Resume Next
Exit Function

Execute_Error:
Resume Execute_Exit
End Function
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top