I
iamjohn66
How would I write to cells in an ole object linked to a word table?
I get the following error "method 'cell' of object 'table' failed"
msgbox "WordTable.object.Application.Documents(1).Tables(1).Cell(colum
row)" works so I know it can read cells like that.
I'm using the code below.
thanks if anyone can help.
Code
-------------------
Dim colum As Integer
Dim row As Integer
Dim count As Integer
colum = 1
row = 1
count = 0
Do Until count = 1
If WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Not Null Then
row = row + 1
End If
If WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Null Then
WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Nametxt.Text
colum = colum + 1
WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Birth.Text
colum = colum + 1
WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Death.Text
count = 1
End If
Exit Do
Loop
Code
I get the following error "method 'cell' of object 'table' failed"
msgbox "WordTable.object.Application.Documents(1).Tables(1).Cell(colum
row)" works so I know it can read cells like that.
I'm using the code below.
thanks if anyone can help.
Code
-------------------
Dim colum As Integer
Dim row As Integer
Dim count As Integer
colum = 1
row = 1
count = 0
Do Until count = 1
If WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Not Null Then
row = row + 1
End If
If WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Null Then
WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Nametxt.Text
colum = colum + 1
WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Birth.Text
colum = colum + 1
WordTable.object.Application.Documents(1).Tables(1).Cell(colum, row) = Death.Text
count = 1
End If
Exit Do
Loop
Code