View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JzP JzP is offline
external usenet poster
 
Posts: 11
Default Copy Method of Sheets Class Failed - after many copies

Hi,
I have an application which allows a user to make several selections
and then, based on those, creates an output workbook. The data for this
is taken from one of 5 input files.
To do this I copy input data sheets into my main workbook, manipulate
it, and then save the output file.
I had problems with the number of copies but, after finding some
excellent advice in this group, I now copy the sheets in in groups.
The problem is that having run the first set of selections ok, when the
next selections are made and the copying of the necessary input
happens, I get the error "Run time error 1004, Copy method of Sheets
Class Failed".
If I close the application betweeen runs then it's fine.

I've tried using a second excel application to open the main one and
run the code but the same thing happens.
Is it possible to force a second copy of excel to run so that when it
is closed it will clear out all its memory? If so is that likely to
help?
Any other suggestions would be appreciated.

The only other option I can think of is to force excel to close each
time but then the user would have to open it again to gernerate each
report.

Many thanks.

John Pomfret