M
Maxer
I have VBA code in word that is going to each table in the word document,
then doing some testing, then moving to each row in the word document, then
finally to each cell.
Once it finishes its tests it moves them over into an Excel worksheet.
Now the process works perfectly for my needs, until I hit a table that has
vertically merged cells.
At my:
------
Set oRows = oTable.Rows
For Each oRow in oRows
'do stuff'
Next oRow
-----
part of the code as soon as it gets to "For Each oRow in oRows" then it
throws up the 5991 error:
Run-time error '5991':
Cannot access individual rows in this collection because the table has
vertically merged cells.
I badly need some way to programmatically split those merged cells.
I actually don't even want those merged cells, they are just the first part
of several tables in the word document. I don't really start moving any data
around until I get a few rows into the table (though the row number varies
table by table).
Anyway, does anyone know of a way I can either test for vertically merged
cells and then just skip to the "Next oRow" or if I can't do that then split
them so that it doesn't stop my code from completing it's processing?
Sadly I can't unmerge them by hand as there are thousands of tables in this
word document and a hundred or so have these merged cells.
Thank you for your help.
then doing some testing, then moving to each row in the word document, then
finally to each cell.
Once it finishes its tests it moves them over into an Excel worksheet.
Now the process works perfectly for my needs, until I hit a table that has
vertically merged cells.
At my:
------
Set oRows = oTable.Rows
For Each oRow in oRows
'do stuff'
Next oRow
-----
part of the code as soon as it gets to "For Each oRow in oRows" then it
throws up the 5991 error:
Run-time error '5991':
Cannot access individual rows in this collection because the table has
vertically merged cells.
I badly need some way to programmatically split those merged cells.
I actually don't even want those merged cells, they are just the first part
of several tables in the word document. I don't really start moving any data
around until I get a few rows into the table (though the row number varies
table by table).
Anyway, does anyone know of a way I can either test for vertically merged
cells and then just skip to the "Next oRow" or if I can't do that then split
them so that it doesn't stop my code from completing it's processing?
Sadly I can't unmerge them by hand as there are thousands of tables in this
word document and a hundred or so have these merged cells.
Thank you for your help.