Copy and paste to other file.

Solved/Closed
carman - Aug 9, 2010 at 04:08 AM
 carman - Aug 9, 2010 at 09:06 PM
Hello,
Can anyone tell me what's wrong with this code? I record it using macro..

Columns("G:M").Select
Selection.Copy
Workbooks.Open Filename:="document.xls"
Windows("document.xls").Activate
Range("A1").Paste
ActiveWorkbook.SaveAs Filename:="document.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False

It's just about copying columns ("G:M:) from my original sheet, open "document.xls" and save it. However, there is a paste error: object doesnt not support this property or method... what can i do to tackle with it?

Thanks.
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Aug 9, 2010 at 02:14 PM
Try Range("A1").PasteSpecial

or activesheet.paste
It works. Thanks again!
0