+ Reply to Thread
Results 1 to 4 of 4

PasteSpecial from a Batch Code failed

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    75

    PasteSpecial from a Batch Code failed

    Hi folks

    This one is doing my head in now!

    I had the below piece of code in a spreadsheet that just listed names of files that had been updated.

    The code is ran by dragging a file (PDF, DOC, XLS) onto a BATCH file which copied the filename to the clipboard then ran a VBS script which opened this spreadsheet and used the SELECTION.PASTESPECIAL to paste the filename into the spreadsheet.

    It has been working fine up until now and i have no idea why - its bring an error on the SELECTION.PASTESPECIAL line - "PasteSpecial method of range class failed"

    Can anyone help, as i have made no changes to anything - its just stopped working!!


    Please Login or Register  to view this content.
    Thanks

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: PasteSpecial from a Batch Code failed

    Remove these two lines

    Please Login or Register  to view this content.
    and replace them with


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-10-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: PasteSpecial from a Batch Code failed

    Tried that, didnt work - got a feeling its not COPYING anything, hence the error.

    Will have to revert back to my Batch code.

    Thanks anyway!

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: PasteSpecial from a Batch Code failed

    Yes, of course, I assumed that you have a line above this line with copy method.

+ 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 worksheet class failed
    By abhi900 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 04-16-2014, 09:32 PM
  2. [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
  3. PasteSpecial Method of Worksheet class failed
    By Gitch28 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2012, 08:54 PM
  4. pastespecial method of range class failed
    By Fansons1 in forum Access Tables & Databases
    Replies: 2
    Last Post: 12-28-2011, 04:56 PM
  5. PasteSpecial Method Failed
    By Hammer_757 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2009, 09:12 AM

Tags for this Thread

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