View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_3_] Peter T[_3_] is offline
external usenet poster
 
Posts: 81
Default XL2003 "paste method of worksheet class failed"

Hi Dave,

If you stop your code after the line
Selection.copy
can you complete the operation manually.

Regards,
Peter

-----Original Message-----

After another look at this problem - I have found that

the paste
operation has been completed successfully (and the data

is still in the
clipboard) then I get the error message.

Just in case the problem was the next line of code - I

inserted a
msgbox line but the error occurred before it got to it.

I will attach the code - it basically runs an autofilter

on a sheet
called 'Data' and then copies and pastes the filtered

dataset to the
'Air' sheet.

Sheets("Data").Select
Selection.AutoFilter Field:=16, Criteria1:="A"

ActiveSheet.Range("A1").Select
ActiveCell.CurrentRegion.Rows.Select
Selection.copy

Sheets("Air").Select
ActiveSheet.Range("A1").Select
ActiveSheet.Paste '<----

Fails at
this point

Application.CutCopyMode = False


Thanks

Dave


--
dave_d
----------------------------------------------------------

--------------
dave_d's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=14608
View this thread:

http://www.excelforum.com/showthread...hreadid=262200

.