I have some code that develops tables in excel and then pastes them into a
Word document. There may be as many as 150 tables, all identical but for the
data values.

After pasting them into Word, I execute a Word macro that loops through the
tables in the document and for each of those I have just pasted in, executes
numerous formatting commands. As each subsequent table is processed, the
code gets slower and slower.

Why is this and is there anything I can do? I have turned off screen
updating, but to no avail.

Re: Table formatting code extremely slow by Jay

Jay
Fri Jul 29 19:35:58 CDT 2005

On Fri, 29 Jul 2005 13:42:06 -0700, Bill Sturdevant
<BillSturdevant@discussions.microsoft.com> wrote:

>I have some code that develops tables in excel and then pastes them into a
>Word document. There may be as many as 150 tables, all identical but for the
>data values.
>
>After pasting them into Word, I execute a Word macro that loops through the
>tables in the document and for each of those I have just pasted in, executes
>numerous formatting commands. As each subsequent table is processed, the
>code gets slower and slower.
>
>Why is this and is there anything I can do? I have turned off screen
>updating, but to no avail.

Hi Bill,

See http://www.word.mvps.org/FAQs/TblsFldsFms/FastTables.htm for some
tips.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org