Run time error 438 Object doesn't support this property

  • I have a directory with 1300 xml files in it. I need to loop through this directory and convert these files into an excel file. I am getting this Run-time 438 error. Any help would be appreciated. The code fails at the xmlFile.Sheets(1).UsedRange.Copy line.
    I can see that a sheet is opened and it is highlighted to be copied.
    Any help is appreciated.



  • Re: Run time error 438 Object doesn't support this property


    At a guess, without testing .... sheet1 Is empty (no data), so used range is nothing, and the copy method is failing. Nothing to copy effectively. Just a guess though.

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

  • Re: Run time error 438 Object doesn't support this property


    It's not that line that's the problem - it's the next one, since a cell doesn't have a Paste method. Use:

    Code
    xmlFile.Sheets(1).UsedRange.Copy xlWkBk.Sheets(1).Cells(LastRow, 1)


    instead.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!