copy method of worksheet class failed

  • Thread starter Thread starter cparsons
  • Start date Start date
C

cparsons

I am getting a "copy method of worksheet class failed " error and a
pretty sure it is because of all the copy statements I am performing.
After about 17 copies I get the error. I am using 2000 and have rea
that this problem was fixed but I am guessing that it hasn't been.

I read where if I save the workbook, close it, and re-open it ever s
many copies then this problem should be fixed.

I must be doing something wrong because once I close it I can't get i
open again. Which made sense because once you close a workbook isn'
your macro closed too, so how can it reopen again.

Anyway does anybody have a simplified way of explaining or showin
this?

Thanks Again
 
The code that keeps getting the error is


Sheets(oldshtName).Activate
Sheets(oldshtName).Copy After:=Worksheets(Worksheets.Count)
ActiveWindow.ActiveSheet.Name = newshtName


This code run anywhere from 1 to 87 times dependending on the user
request
 
Hi
depending on the size of your worksheets and your environment you may
have hit the maximum number of worksheets. How large is your file after
running it 87 times?
 
I have never been able to create 87 worksheets because the copy ste
errors out after about 17 copies, everytime. The worksheet's that d
get copied are about 100KB each. So the size of the file doesn't see
to be a problem.

Thanks
 

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

Back
Top