troubleshooting Question

Error 438"Object Doesn't Support This Property or Method

Avatar of Jenedge73
Jenedge73Flag for Afghanistan asked on
Microsoft ExcelMicrosoft ApplicationsMicrosoft Office
7 Comments1 Solution1578 ViewsLast Modified:
I need an expert

I have a code to Copy one range to another range i a workbook
I keep getting the 438  at this point

Dest.Worksheet("Options").Activate
    Range("A57").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

I'm using Excel 2010


Sub LoopFiles()
Dim wb As Workbook
Dim ws As Worksheet
Dim strExt As String
Dim strPath As String    ' Change folder name to the folder with the files in it
Dim strFilename As String

    strExt = "*.xls*"

    strPath = "C:\Users\rascott\Desktop\West\Prairie\Cat Code 7\"

    strFilename = Dir(strPath & strExt)

    While Len(strFilename) > 0

        Set wb = Workbooks.Open(Filename:=strPath & strFilename)


            Dim Source As Workbook
            Dim Dest As Workbook

    Set Dest = ThisWorkbook
   
    Set Source = Workbooks.Open("C:\Users\rascott\Desktop\Copy of Trade Class Working Copy - Sept 24.xlsx") 'change path

    Source.Worksheets("Template PRA").Range("A57:C337").Copy 'change sheet ref

    Dest.Worksheet("Options").Activate
    Range("A57").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

    Application.CutCopyMode = False

    Dest.Close False

    ThisWorkbook.Activate

    MsgBox "Done"
   
        wb.Close SaveChanges:=False

        strFilename = Dir
    Wend

End Sub

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros