View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jon[_18_] Jon[_18_] is offline
external usenet poster
 
Posts: 5
Default VBA execution stops at ActiveSheet.Copy -- but only sometimes!

This is a known bug with Excel. There is a Microsoft KB article that
outlines a workaround. Basically you need to add a new sheet to your
workbook from a template, and paste the contents of the text file onto
this new sheet each time through your loop.

This supposedly only affects earlier versions of Excel, but I've seen
it in Excel 2003 when I copy 100 sheets or more.

Here's a link to the KB article:
http://support.microsoft.com/default...b;en-us;210684

The description of the issue in the article may not match your
symptoms exactly, but I think if you try the template approach, you
should get the results you want.

-Jon Crowell