+ Reply to Thread
Results 1 to 2 of 2

Getting runtime error 1004 PasteSpecial method of Range class failed

Hybrid View

  1. #1
    Registered User
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    87

    Getting runtime error 1004 PasteSpecial method of Range class failed

    Hi Guys,

    I am getting a strange bug. For some reason, it will only succeed on the alternative attempt. If it runs successfully the first time, the second time will have the 1004 error. If I get the error the first time, I can just end the debug message pop up without touching any code then run it again and it will work. I can't get my head around it....... Please help, thanks!

    If (CLng(Now) - Sheet2.Range("E34").value) > -1 Then
    Dim UpdateInvTableAns As Integer
    UpdateInvTableAns = MsgBox("Would you like to synchronise invoice data table?", vbQuestion + vbYesNo + vbDefaultButton2, "Synchronisation Confirmation")
    If UpdateInvTableAns = vbYes Then
        Workbooks("StockReference.xlsm").Worksheets("InvoiceData").ListObjects("InvoiceDataTable").DataBodyRange.Copy
        Sheet12.Range("A2").PasteSpecial Paste:=xlPasteValues
        Application.CutCopyMode = False
        MsgBox "Invoice table successfully updated, with time stamp " & Format(Workbooks("StockReference.xlsm").Worksheets("StockList").Range("A2").value, "DD/MM/YYYY HH:MM:SS") & ".", vbInformation, "Synchronisation Successful"
        Sheet2.Range("E34").value = Workbooks("StockReference.xlsm").Worksheets("StockList").Range("A2").value
    End If
    End If

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Getting runtime error 1004 PasteSpecial method of Range class failed

    What line errors?
    It would help if you supplied a sample wb for testing.

+ 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. runtime error 1004 pastespecial method of range class failed
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2021, 11:08 PM
  2. Runtime error 1004 - PasteSpecial method of Range class failed
    By Ruthie09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2016, 08:17 PM
  3. PasteSpecial method of range class failed error 1004
    By iwannabakat in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-05-2014, 08:51 PM
  4. [SOLVED] Runtime error PasteSpecial method of Range class failed
    By russ50 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 02:27 AM
  5. runtime error 1004 pastespecial method of range class failed
    By JillCALIBRE in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-30-2009, 11:31 AM
  6. runtime error 1004 pastespecial method of range class failed
    By dreamz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2006, 10:57 AM

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