Error fails to call Error Handler routine

M

Matthew Williams

Hi

I've written a macro that converts all the tables in a document to text by merging the cells in each column and then converting the whole table to text. It works on simple tables and even some more complex ones, but in tables that have a lot of merged cells, it fails.

To allow the macro to skip complex tables and continue executing, I've written an errorhandler that seems to work for the most part, but I have run into one table that cannot be converted and that does not invoke the errorhandler. I get a run-time 5991 error ("Cannot access individual rows in this collection because the table has vertically merged cells").

Does anyone have any insight as to why this error does not invoke the error handler while other errors do (I know it's working because another table in the document before this one throws a different error)? Is there a way to get around this error? I'm not particularly worried about converting the table, but I would like to be able to bypass it.

Thanks

m.
 
J

Jezebel

Some errors are not trappable -- it's a function of where the error is
raised. Have you tried setting DisplayAlerts = FALSE ?


Matthew Williams said:
Hi

I've written a macro that converts all the tables in a document to text by
merging the cells in each column and then converting the whole table to
text. It works on simple tables and even some more complex ones, but in
tables that have a lot of merged cells, it fails.
To allow the macro to skip complex tables and continue executing, I've
written an errorhandler that seems to work for the most part, but I have run
into one table that cannot be converted and that does not invoke the
errorhandler. I get a run-time 5991 error ("Cannot access individual rows in
this collection because the table has vertically merged cells").
Does anyone have any insight as to why this error does not invoke the
error handler while other errors do (I know it's working because another
table in the document before this one throws a different error)? Is there a
way to get around this error? I'm not particularly worried about converting
the table, but I would like to be able to bypass it.
 

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