MalcolmReynolds
New Member
- Joined
- Jan 20, 2017
- Messages
- 4
Is it possible to create a table in Word from Excel, and then use code to add text in particular cells in the new table?
I have code to create a new word doc, but am not sure how to go about adding the table or adding text in particular cells. I'm OK with Excel/Access VBA, but haven't had to use it in Word.
Is what I'm after possible?
Thanks in advance!
I have code to create a new word doc, but am not sure how to go about adding the table or adding text in particular cells. I'm OK with Excel/Access VBA, but haven't had to use it in Word.
Code:
Dim wApp As Object
Set wApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Err.Clear
Set wApp = CreateObject("Word.Application")
End If
wApp.Visible = True
wApp.Documents.Add DocumentType:=0
'Add table
'Set values of table cells
Is what I'm after possible?
Thanks in advance!