Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Method 'Copy' of object'_Worksheet failed

Afternoon,

I have th following macro to create a number sheets based on a list,
name each sheet as per name on the list and then to copy paste a
template onto each sheet. Sounds so (b)loody simple except for a
little error message that pops up when its time to copy paste the
template:
Method 'Copy' of object'_Worksheet failed.

The macro looks like this:
Dim wstemp As Worksheet
Dim Rng As Range
Dim ListRng As Range
Set wstemp = Worksheets("Template") 'this is the one to copy
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
wstemp.Copy after:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = Rng.Text
End If
Next Rng
End Sub

And the debug is on this line
wstemp.Copy after:=Worksheets(Worksheets.Count)

So know to the world I ask for your assistance in sorting this little
thorn in my side.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Method 'Copy' of object'_Worksheet failed

Are any of the sheet names defined in your range over 32 characters
long or have any characters unacceptable to worksheet names? Probably
not the actual solution, but you never know.....

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Method 'Copy' of object'_Worksheet failed

See this KB

Copying Worksheet Programmatically Causes Run-Time Error 1004
http://support.microsoft.com/default...84&Product=xlw


--

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


wrote in message oups.com...
Afternoon,

I have th following macro to create a number sheets based on a list,
name each sheet as per name on the list and then to copy paste a
template onto each sheet. Sounds so (b)loody simple except for a
little error message that pops up when its time to copy paste the
template:
Method 'Copy' of object'_Worksheet failed.

The macro looks like this:
Dim wstemp As Worksheet
Dim Rng As Range
Dim ListRng As Range
Set wstemp = Worksheets("Template") 'this is the one to copy
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
wstemp.Copy after:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = Rng.Text
End If
Next Rng
End Sub

And the debug is on this line
wstemp.Copy after:=Worksheets(Worksheets.Count)

So know to the world I ask for your assistance in sorting this little
thorn in my side.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Method 'Copy' of object'_Worksheet failed

I find the "Resolution" in this article to be cumbersome, but the
"Workaround" is fine. If I need anything from the sheet which I would have
copied, I use Copy & Paste Special.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ron de Bruin" wrote in message
...
See this KB

Copying Worksheet Programmatically Causes Run-Time Error 1004
http://support.microsoft.com/default...84&Product=xlw


--

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


wrote in message
oups.com...
Afternoon,

I have th following macro to create a number sheets based on a list,
name each sheet as per name on the list and then to copy paste a
template onto each sheet. Sounds so (b)loody simple except for a
little error message that pops up when its time to copy paste the
template:
Method 'Copy' of object'_Worksheet failed.

The macro looks like this:
Dim wstemp As Worksheet
Dim Rng As Range
Dim ListRng As Range
Set wstemp = Worksheets("Template") 'this is the one to copy
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
wstemp.Copy after:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = Rng.Text
End If
Next Rng
End Sub

And the debug is on this line
wstemp.Copy after:=Worksheets(Worksheets.Count)

So know to the world I ask for your assistance in sorting this little
thorn in my side.

Thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Method 'Copy' of object'_Worksheet failed

I agree with you Jon

--

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


"Jon Peltier" wrote in message ...
I find the "Resolution" in this article to be cumbersome, but the
"Workaround" is fine. If I need anything from the sheet which I would have
copied, I use Copy & Paste Special.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ron de Bruin" wrote in message
...
See this KB

Copying Worksheet Programmatically Causes Run-Time Error 1004
http://support.microsoft.com/default...84&Product=xlw


--

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


wrote in message
oups.com...
Afternoon,

I have th following macro to create a number sheets based on a list,
name each sheet as per name on the list and then to copy paste a
template onto each sheet. Sounds so (b)loody simple except for a
little error message that pops up when its time to copy paste the
template:
Method 'Copy' of object'_Worksheet failed.

The macro looks like this:
Dim wstemp As Worksheet
Dim Rng As Range
Dim ListRng As Range
Set wstemp = Worksheets("Template") 'this is the one to copy
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
wstemp.Copy after:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = Rng.Text
End If
Next Rng
End Sub

And the debug is on this line
wstemp.Copy after:=Worksheets(Worksheets.Count)

So know to the world I ask for your assistance in sorting this little
thorn in my side.

Thanks



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
Method 'Copy' of object'_Worksheet failed q2w3e4r Excel Worksheet Functions 1 February 7th 07 01:17 PM
Copy method of worksheet class failed - help! Chet Shannon[_4_] Excel Programming 11 April 10th 06 05:18 AM
Copy method failed Daniel Bonallack Excel Programming 2 October 14th 05 05:24 AM
Copy method of chart class failed St. Nick Excel Programming 1 July 16th 04 03:21 AM
Copy Method of Worksheet Class Failed Steph[_3_] Excel Programming 2 April 7th 04 01:43 PM


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

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"