I am using vba code as code assigned to a button on a user form.
The offending code is
Dim mytable As Table
Set mytable = ActiveDocument.Tables(1)
MsgBox (mytable.Cell(1, 1))
id = student(numc, 2) ' where numc is
an integer used to select the sorrect table row
mytable.Columns(1).Cells(1) = id 'Student is an array holding
values read from the form
It falls over highlighting the code ".Cells(1)=" in blue stating error
message " invalid use of property".
The help at that point talks about property let and property get statements ?
I have also tried mytable.Cells(numc,1) and mytable.cells(1, 1) just to try
and get it working with no joy
Please help
Tony Jollans - 21 Mar 2006 15:44 GMT
Try using ...
mytable.Columns(1).Cells(1).Range = id
or, more explicitly, ...
mytable.Columns(1).Cells(1).Range.Text = id
--
Enjoy,
Tony
> I am using vba code as code assigned to a button on a user form.
> The offending code is
[quoted text clipped - 17 lines]
>
> Please help
mark_jm - 21 Mar 2006 20:22 GMT
Fantastic....thanks .............you dont know how long I've been messing
about with that
Regards
Mark
>Try using ...
>
[quoted text clipped - 13 lines]
>>
>> Please help