Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Method of Workseet Class Failed

Hey there,

I am having an issue with one of my macros, and was wondering if anyone here
can help.

To start off, I have searched throughout Google, and it seems that the only
answer I can find on there has to do with issues in previous versions of
Excel - problems that were solved in Excel 2002, which is what I have.

Anyways, I have a fairly big project where I am running 400 records of data
through a macro - it runs fine up until record 280, when I get the error
listed above. Pretty much, the 400 records are getting split into MANY
different workbooks - up to 100 different workbooks based on various
criteria.

Here is the code itself:

Set wkb = Workbooks("Initialize.xls")
wkb.Activate
Sheets("Template").Select

''The next line is where the error occurs
Sheets("Template").Copy Befo=Workbooks(WksVar.Range("Filename").Value &
"msts.xls").Worksheets(1)

Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Copy Method of Workseet Class Failed

Is it possible, that you have too many worksheets in the
workbook, where you are trying to copy a new sheet. The
only limitation of sheets in a workbook in Excel 2002 is
the amount of available memory.

Ecco
-----Original Message-----
Hey there,

I am having an issue with one of my macros, and was

wondering if anyone here
can help.

To start off, I have searched throughout Google, and it

seems that the only
answer I can find on there has to do with issues in

previous versions of
Excel - problems that were solved in Excel 2002, which is

what I have.

Anyways, I have a fairly big project where I am running

400 records of data
through a macro - it runs fine up until record 280, when

I get the error
listed above. Pretty much, the 400 records are getting

split into MANY
different workbooks - up to 100 different workbooks based

on various
criteria.

Here is the code itself:

Set wkb = Workbooks("Initialize.xls")
wkb.Activate
Sheets("Template").Select

''The next line is where the error occurs
Sheets("Template").Copy Befo=Workbooks(WksVar.Range

("Filename").Value &
"msts.xls").Worksheets(1)

Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues,

Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 3 April 14th 09 10:35 PM
Why am I getting R/T 1004 - Copy method of Rng class failed? Jim May Excel Discussion (Misc queries) 2 April 21st 08 05:14 PM
Error 1004 Copy method of worksheet class failed Ayo Excel Discussion (Misc queries) 3 March 28th 08 02:05 PM
Autofill method of range class failed Don Guillett Excel Discussion (Misc queries) 0 February 27th 08 03:56 PM
Autofill method of range class failed Appache Excel Discussion (Misc queries) 5 February 27th 08 03:37 PM


All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"