Copying a sheet fails

M

Michelle

I have a line that copies a sheet from one book to another. It works a
number of times in my macro then inexplicably stops working.

The line is:
ActiveSheet.Copy Before:=Workbooks(NewBookName).Sheets("XXX")

And I get the error: 1004
"Copy method of worksheet class failed"

It stops when I try to add the 54th sheet in a workbook - I don't know if
that number is significant.

There is no problem with the string: 'NewBookName' or the sheet named 'XXX'
(as I say the line works 52 times)

But suddenly I get an error

Anyone seen this before?

Thanks

M
 
J

JLGWhiz

There have been several similar postings about this condition. In most
cases, I believe the resolution was to make a loop where after so many
copies it would break and then resume. But I don't relly remember all the
details.
 

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