Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object does not support method on Copy Destination

Status
Not open for further replies.

Ebes1099

Technical User
Jul 8, 2009
156
US

I'm getting a Runtime error 438 Object does not support this property or method on the bolded line of code below. It's a pretty simple copy and paste so I'm not sure why. The named range "Plan_Name_Hdr" exists in the destination workbook, supp.

Code:
Dim model_one As String, model_one_Full As String, supp As String
    Dim x As Integer
    
    supp = "Exhibits v2.xlsm"
    model_one = "model_1.xlsm"
    model_one_Full = "C:\Users\user1\Desktop\Doc" & "\" & model_one
    
    Workbooks.Open Filename:=model_one_Full

    'Used for offest formulas
    x = 0

    Sheets("Main").Activate
    [b]Range("A13").Copy Destination:=Workbooks(supp).Range("Plan_Name_Hdr").Offset(0, x)[/b]
 
Hi,

Do you actually have a RANGE NAME of Plan_Name_Hdr?

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
I do.

I tried replacing that line with these few lines to see if this would work and it does exactly what I want.

Code:
Dim tmp As String
Sheets("Main").Activate
    tmp = Range("A13").Value
    Workbooks(supp).Activate
    Range("Plan_Name_Hdr").Value = tmp

Is it something in my Destination statement, or something to do with the Destination being in a different workbook? Could I have missed an argument?
 
Even if I put in a cell reference instead of the Named Range I get the same error.
 
How about a sheet name?
Code:
Range("A13").Copy Destination:=Workbooks(supp)[highlight #FCE94F].worksheets(???)[/highlight].Range("Plan_Name_Hdr").Offset(0, x)

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
other than that try...
Code:
    x = 0

    Workbooks(model_one_Full).Sheets("Main").Range("A13").Copy
    Workbooks(supp)[highlight #FCE94F].WorkSheet(???)[/highlight].Range("Plan_Name_Hdr").Offset(0, x).xlPasteSpecial xlPasteAll

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top