paste special dont work

auto

Board Regular
Joined
May 20, 2012
Messages
53
hi, i am having a vba code which needs to collect data from a webpage and paste the vallues in my excell sheet, somehow when i make the code it should just past it, then it will work but when i use the option xlpastespecial xlpastevallues then i get an error "method pastespecial of object_worksheet failed" can someone explain me why?
here is the basic code, there is some coding i didnt mention, i placed only the coding which should effect on this error.

Dim xlWB As Excel.Workbook Dim xlSheet2 As Excel.Worksheet

Dim final As Range


Set xlWB = xlApp.Workbooks.Open(sFilePath & strPath) Set xlSheet2 = xlWB.Sheets("Sheet2")

Set final = xlSheet2.Range("A1")

ie.ExecWB 17, 0
ie.ExecWB 12, 0
final.PasteSpecial xlPasteValues
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Taken back I can see where that was set
 
Last edited:
Upvote 0
Paste Values is not an option in paste special if you copy from a web page.
 
Upvote 0

Forum statistics

Threads
1,216,495
Messages
6,130,979
Members
449,611
Latest member
Bushra

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