'1004 Excel cannot paste the data' - Copying from SAP new issue

marc81

New Member
Joined
Aug 3, 2017
Messages
17
Hi,

I have created a few tools in Excel that use VBA to access SAP, copy data from SAP then paste it back in to an Excel workbook. They have been working fine for a couple of years, but now whenever they get to the activesheet.paste I am getting error 1004 'Excel cannot paste the data'. The odd thing is that if you debug and hit F5 it pastes the data and carries on fine. The macro also works fine if you have the VBA window open. I've tried writing new scripts and get the same issue. Any ideas why this would happen all of a sudden?

Thanks,
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
your script copies data from SAP and pastes it into excel? wanna share your code to take a look? (I use scripts to access SAP via VBA as well).
 
Upvote 0
try to slow down the process at your critical point(s).
By adding "Doevents" you force everything to synchronise, but even then it's not always enough.
stupid example
VBA Code:
   Range("B1").Copy
     DoEvents
     Range("C1").PasteSpecial xlValues
Can you give the 5 last lines before that error.
 
Upvote 0

Forum statistics

Threads
1,223,978
Messages
6,175,754
Members
452,667
Latest member
vanessavalentino83

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