+ Reply to Thread
Results 1 to 13 of 13

"Run-time error: '438': Object doesn't support this property or method" & Selection.Paste

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    "Run-time error: '438': Object doesn't support this property or method" & Selection.Paste

    When I try to run the program, I get the following message.:
    Run-time error: '438':
    Object doesn't support this property or method
    Here is the macro with the part that is highlighted yellow when I click "Debug" underlined.:
    Please Login or Register  to view this content.
    What am I doing wrong?

    Any help in getting past this error would be appreciated!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    Try this, which is one line of code.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    I put

    Please Login or Register  to view this content.
    all on one line and, I get a syntax error and, the line's text is coloured red.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    Sorry, looks like I wasn't clear.

    It is one line already - I've used the line continuation character '_' to spread it over 2 lines to make it readable.

  5. #5
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    Using the following one-liner is also not working.:
    Please Login or Register  to view this content.
    This is the message given.:
    Run-time error '1004':
    Application-defined or object-defined error
    Also, what was wrong with that I was doing initially?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    The earlier problem was that the Selection was a range and a range doesn't have a Paste method or property.

  7. #7
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    What similar thing does have a Paste method or property?

    Also, what's going on with the syntax you demonstrated?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    Not sure what you mean.

    Paste can apply to a whole bunch things, you'll find them all in the Object Browser (F2) if you search for Paste.

    As for the syntax, there's nothing wrong with it.

    The error you describe is a run-time error not a syntax error.

  9. #9
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    Okay so, the Visual Basic Editor must be making a mistake or something since
    Please Login or Register  to view this content.
    is highlighted in yellow when I click "Debug".

    Do you any idea what could be happening?

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    If it was a syntax error the line would be highlighted red, as the code in #3 was, before you even ran the code.

    When a line is highlighted yellow when you run the code and hit debug it means it's a run-time error.

    One possible problem could be that a variable/variables in that line of code were incorrect.

    Can you attach the workbook associated with the code?

  11. #11
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    Actually, I found the mistake.

    The
    Please Login or Register  to view this content.
    line was commented out.

    I fixed a few other mistakes and now my program's problem is logical (instead of syntax or run-time error related).

    Thanks for your help.

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    So one of the variables was incorrect.

  13. #13
    Registered User
    Join Date
    11-06-2012
    Location
    ndemene
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: "Run-time error: '438': Object doesn't support this property or method" & Selection.Pa

    Yes, I realized that the "lastColDest" variable was not initialized which was why I had uncommented it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1