error 5992

J

John

I have a macro that I have used daily in Word 2000-2002
versions with no problem. I am now receiving error 5992.
Exact message is:

Run-time error '5992':

Cannot access individual columns in this collection
because the table has mixed cell widths.

I use Word as my time sheet at work. It has 5 columns.
When I run this macro it goes to the bottom of the table
(only 1 table in document), then, if that row is not
empty, a new row is added, and the current time is placed
in column #2. The macro is:

Sub TimeRow()
'
' TimeRow Macro
' Written 1/1/2002 by John Wm Beckner
'
' Checks Last Row, 2nd column cell contents. If something
is there,
' add a row. Select last cell in 2nd column. Put the time
in the cell.
' Advance to next cell and await input.
'
Set otimetable = ActiveDocument.Tables(1) 'use 1st
(and only) table in document
Set oTimeColumn = otimetable.Columns(2) 'time column
Dim iLastCell As Integer
iLastCell = oTimeColumn.Cells.Count
Set oLastTimeCell = oTimeColumn.Cells(iLastCell)
oLastTimeCell.Select
If Asc(Selection.Text) <> 13 Then
Selection.SelectRow
Selection.InsertRowsBelow
iLastCell = oTimeColumn.Cells.Count
Set oLastTimeCell = oTimeColumn.Cells(iLastCell)
oLastTimeCell.Select
End If
'put time in cell
InsertTime ' another macro
End Sub


The error occurs on the second stmt. The object
otimetable.Columns(2) does not exist because the error
states my columns have mixed cell widths. They don't. I
have set them to fixed widths and this has not resolved
the issue.

Any assistance appreciated. Upon request, I can send
the .DOC file.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top