Intermittent problem with PasteSpecial Method of Worksheet Class Failed

Photomofo

Active Member
Joined
Aug 20, 2012
Messages
259
I'm downloading some data from a webpage and pasting it to a worksheet. I've gotten most of the bugs out of the process but I'm periodically getting this PasteSpecial Method issue popping up? By periodically I mean 1 out of 1000 page downloads.

How can I test to see if this "alarm" is going to come up? Is there a way to override the alarm and retry the paste? If X error occurs, wait 5 seconds and retry...

Here's the specific snippet of code.

Code:
Application.DisplayAlerts = False
ActiveSheet.PasteSpecial Foremat:="Text", link:=False, DisplayAsIcon:=False
Application.DisplayAlerts = True
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hmmm... It appears the error is occurring on January 1st. January 1st is the trigger in the program to paste a year's worth of data to the worksheet before continuing to download data... Perhaps excel was still busy completing the last paste (a bigger annual paste) so when I ask it to paste January 1st's data it gets hung up? I dunno. I took the annual paste out of the code to test to see if things still hang up?

Nope... Still hanging up periodically.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,547
Messages
6,120,139
Members
448,948
Latest member
spamiki

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