+ Reply to Thread
Results 1 to 3 of 3

Run-time error 1004: Paste method of worksheet class failed

  1. #1
    Registered User
    Join Date
    05-07-2019
    Location
    Austin, Texas
    MS-Off Ver
    Office 365 pro plus
    Posts
    0

    Run-time error 1004: Paste method of worksheet class failed

    Hello everyone, My name is Naveen.

    I wrote a code to collect data from multiple sources using userforms. My code is working on almost 85% to 90% of the audience's computers but giving me the above mentioned error on 10%-15% of the audience.
    Code:

    Set NewBook = Workbooks.Add
    NewBook.SaveAs Filename:=loc & "" & surveyfilename, FileFormat:=xlWorkbookDefault 'loc is a variable for location.
    Windows(nam).Activate 'nam is name of file I am copying from
    Worksheets("Storage").Activate
    Range(Cells(1, 1), Cells(1, 1175)).Select
    Selection.Copy
    Workbooks.Open Filename:=loc & "" & surveyfilename & ".xlsx" 'new file I just created
    Workbooks(surveyfilename & ".xlsx").Activate
    ActiveSheet.Paste
    ActiveWorkbook.Save
    ActiveWindow.Close

    It shows my error is in ActiveSheet.Paste line.

    Thanks in advance.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello NaveenWFM,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Run-time error 1004: Paste method of worksheet class failed

    Hi,

    As you may be read description of this sub-forum - this one is solely to introduce yourself.

    So here I'd say: welcome to the forum. And that's it.

    With your merit question, please go to appropriate sub-forum. Look what sub-forums we have: http://www.excelforum.com/microsoft-...el-help-forum/ and post a new thread in one of them (the most appropriate one).

    PS. Please observe our Rules https://www.excelforum.com/forum-rul...rum-rules.html - one of them is to have the code in appropriate tags
    Best Regards,

    Kaper

+ 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. Run-time error '1004': Paste method of Worksheet class failed
    By Kennethc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2018, 06:28 AM
  2. Run Time Error '1004': Paste Method of Worksheet Class Failed
    By greuben in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2015, 02:25 PM
  3. Replies: 10
    Last Post: 01-28-2014, 02:05 PM
  4. Getting Run-Time error '1004': Paste method of Worksheet class failed
    By randomguy1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2013, 10:47 PM
  5. [SOLVED] Run-time error 1004 paste method of worksheet class failed
    By Castillb in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-12-2013, 02:24 PM
  6. Help with a Macro-Paste method of worksheet class failed run time error 1004
    By mcneill_garr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-10-2011, 03:10 PM
  7. Run-time error '1004': Paste method of Worksheet class failed
    By shafto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2009, 07:49 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