Copy and paste to other file.

[Solved/Closed]
Report
-
 carman -
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.

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Try Range("A1").PasteSpecial

or activesheet.paste
It works. Thanks again!