Run Time Error '1004' PasteSpecial method of worksheet class failed

Nelson78

Well-known Member
Joined
Sep 11, 2017
Messages
526
Office Version
  1. 2007
Hello everybody.

I'm grasping datas from a website via vba, but I'm struggling with the

Run Time Error '1004' PasteSpecial method of worksheet class failed

This is the impacted part of the code:

Code:
    IE.ExecWB 17, 0            ' SelectAll
    IE.ExecWB 12, 2            ' Copy selection
    ActiveSheet.PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False
    Range("A1").PasteSpecial

The code selects all correctly (I see the highlighted page).

The error is, of course, on the following line:

Code:
ActiveSheet.PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False

Any ideas?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
so what does Activesheet point to when due to paste, 1004 usually indicates something is missing, you have NO range identified !
 
Upvote 0
In this way the same error:

Code:
Workbooks("Cartel1").Worksheets("Sheet 1").PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False

Could it be a problem of a large amount of datas?
 
Upvote 0
Removing the line with the error, it seems to work.
But I don't know if I can remove link and images.

Code:
    IE.ExecWB 17, 0            ' SelectAll
    IE.ExecWB 12, 2            ' Copy selection
    
    Range("A1").PasteSpecial
 
Upvote 0
what would
Workbooks("Cartel1").Worksheets("Sheet 1").range("a1").PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False

Do
 
Upvote 0
Above the attempts:

1)
Code:
Workbooks("Cartel1").Worksheets("Sheet 1").Range("a1").PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False
Run Time Error 1004 'Application Defined or Object Defined Error'

2)
Code:
Range("a1").PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False
Compile error: can't find predefined argument
(or something like this, I haven't found the exact translation in english)
highlighting on
Code:
Format:=

3)
Code:
Range("a1").PasteSpecial

This is ok but with the legacy of links and images.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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