PC Review


Reply
Thread Tools Rate Thread

Copying a sheet fails

 
 
Michelle
Guest
Posts: n/a
 
      18th May 2010
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

 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      18th May 2010
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.


"Michelle" <(E-Mail Removed)> wrote in message
news:1583A1D3-8908-49D2-90AC-(E-Mail Removed)...
>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



 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      18th May 2010
See
http://support.microsoft.com/kb/210684/en-us

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm



"JLGWhiz" <(E-Mail Removed)> wrote in message news:eY#(E-Mail Removed)...
> 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.
>
>
> "Michelle" <(E-Mail Removed)> wrote in message
> news:1583A1D3-8908-49D2-90AC-(E-Mail Removed)...
>>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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help Taking alot data from one sheet (if not blank) and copying toa list on another sheet. Alex Zuniga Microsoft Excel Worksheet Functions 1 25th Nov 2009 11:54 PM
copying a template sheet and inputting a formula into another sheetthat references the new sheet A & S Microsoft Excel Programming 1 29th Jul 2009 08:59 PM
Select a Sheet Issue in VBA on a very hidden sheet - fails christopher ward Microsoft Excel Programming 6 21st Jul 2009 01:30 PM
Copying rows values on one sheet to part of a formula in a column onanother sheet. Manosh Microsoft Excel Discussion 2 23rd Jun 2009 03:58 AM
Copying cells from on sheet to another sheet (via sheet module) =?Utf-8?B?Q1JheUY=?= Microsoft Excel Programming 6 20th Sep 2005 08:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:34 AM.