+ Reply to Thread
Results 1 to 5 of 5

pastespecial method of range class failed

  1. #1
    Registered User
    Join Date
    03-12-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    36

    pastespecial method of range class failed

    Hello People,

    I'm trying to get the data that i input into one workbook to be pasted into a database in another workbook.

    So far I've pretty much gotten what i want except for one crucial part which is pasting the copied data into the new workbook. Below is the code that I've been constructing, what it does is copy a selection from the open workbook's second sheet and then opens the right sheet in the workbook i want it copied to and selects the right range to where it should be copied.

    The issue i'm facing is then when i try to paste the values using .PasteSpecial i get the error message "pastespecial method of range class failed", However I can't seem to find out what I've done wrong to cause this error.

    If anyone has any suggestions it would be greatly appreciated.

    With regards,

    Rekragisao

    End with

    Please Login or Register  to view this content.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: pastespecial method of range class failed

    Hi,

    I imagine that opening the other workbook has cleared the clipboard. Why are you using two separate routines to perform this task? Further, what is the Wait and Sendkeys part required for?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    03-12-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    36

    Re: pastespecial method of range class failed

    Hey,

    the sendkeys is just to shift the selection back from column B to A so that the data is pasted in the right colomn since A has no values in it. the wait command i added because else the sendkeys command wouldn't go trough for some reason.

    I initially used 2 seperate routines because when trying to do it in one i kept running into errors. I'll give a shot at merging the 2 into one to see if that will fix the pasting issue.

    Thanks for the imput

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: pastespecial method of range class failed

    Perhaps this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-12-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    36

    Re: pastespecial method of range class failed

    This works like a charm

    Thanks you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PasteSpecial method of Range class failed
    By jjosey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2015, 07:44 AM
  2. [SOLVED] PasteSpecial method of Range Class failed!
    By tharindudk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-03-2014, 01:40 AM
  3. [SOLVED] PasteSpecial Method of Range Class Failed
    By mrbickelsworth in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-05-2013, 06:40 PM
  4. [SOLVED] PasteSpecial method of Range class failed
    By lottidotti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2013, 08:21 AM
  5. PasteSpecial method of Range class failed
    By siddharth.sinha in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-11-2010, 01:07 PM
  6. PasteSpecial method of Range class failed
    By reborges in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2007, 02:27 PM
  7. PasteSpecial method of Range class failed
    By windsor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-06-2005, 06:05 PM

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