Run-time error '1004': Paste method of Worksheet class failed

Bob Ully

Board Regular
Joined
Jun 4, 2013
Messages
66
Friends,

I am getting this error in a Macro that copies from one worksheet to another. I've checked the usual things. Made sure there are no merged cells.

Run-time error '1004': Paste method of Worksheet class failed

The macro had been running with no problems for several months. It is a monthly job. The tab I am copying is large 10,000 rows.

Any Ideas ????

Thanks, for your time. Bob Ully
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Can you post the code?

Sub Macro1()
' Macro1 Macro
' Copy Master for Setup
Sheets("Macros").Select
F1 = Range("E9").Value
Sht1 = Range("E10").Value

D1 = Range("E5").Value
Drive1 = Range("E6").Value
ChDir (D1)
ChDrive (Drive1)

Application.Calculation = xlManual
Workbooks.Open Filename:=F1
Sheets(Sht1).Select
Cells.Select
Selection.Copy
ActiveWorkbook.Close
Sheets("Master").Select
ActiveSheet.Paste
Application.Calculation = xlAutomatic

End Sub

It Interrupts at "ActiveSheet.Paste". Bob U. Thanks
 
Upvote 0
Does this work?
Code:
Option Explicit

Sub Macro1()
' Macro1 Macro
' Copy Master for Setup
    With Sheets("Macros").Select
        F1 = .Range("E9").Value
        Sht1 = .Range("E10").Value

        D1 = .Range("E5").Value
        Drive1 = .Range("E6").Value
    End With

    ChDir (D1)
    ChDrive (Drive1)

    Application.Calculation = xlManual
    
    Workbooks.Open Filename:=F1
    
    ActiveWorkbook.Sheets(Sht1).Cells.Copy ThisWorkbook.Sheets("Master").Range("A1")
    
    ActiveWorkbook.Close
    
    Application.Calculation = xlAutomatic

End Sub
 
Upvote 0
Does this work?
Code:
Option Explicit

Sub Macro1()
' Macro1 Macro
' Copy Master for Setup
    With Sheets("Macros").Select
        F1 = .Range("E9").Value
        Sht1 = .Range("E10").Value

        D1 = .Range("E5").Value
        Drive1 = .Range("E6").Value
    End With

    ChDir (D1)
    ChDrive (Drive1)

    Application.Calculation = xlManual
    
    Workbooks.Open Filename:=F1
    
    ActiveWorkbook.Sheets(Sht1).Cells.Copy ThisWorkbook.Sheets("Master").Range("A1")
    
    ActiveWorkbook.Close
    
    Application.Calculation = xlAutomatic

End Sub

I had to take out "." before Range. Then when I ran it, it got "hung-up", where I would get the blue circle, for more than 5 minutes, I interrupted it then.

I was able to copy the sheet manually, and the user is proceeding. I will also check the sheet, maybe someone merged some cells, so the copy isn't working.

Appreciate your time, Norie. Let me know if you have any other ideas, I'll try to come up with a work around. Bob Ully
 
Upvote 0

Forum statistics

Threads
1,213,483
Messages
6,113,919
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top