Web select all wont select...

ashleyw6

New Member
Joined
Mar 7, 2011
Messages
6
Hi all,

I have a code that logs into a web site and navigates to a certain page, the code works great up to this point, i want the code to select all and copy to be pasted into a worksheet later. The problem is that the code wont select all the webpage unless i click the page as im stepping through the code... I think that the webpage needs to be selected somehow???

Below is a snippet of the code that selects and copies...

Code:
IE.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT
IE.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT

Sheets("Data").Select
Range("A1").Select
ActiveSheet.PasteSpecial Format:="html", link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
Application.CalculateFull

Thanks for the help,

Ash
 

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,)
It's difficult to say why without knowing the URL of the web page, or seeing your code from the IE.Navigate line, but "unless i click the page as im stepping through the code" indicates that the page isn't ready when you run the code without the debugger. Therefore try putting:
Code:
        While IE.busy Or IE.ReadyState <> 4
            DoEvents
        Wend
between the Navigate and the ExecWB lines.
 
Upvote 0

Forum statistics

Threads
1,215,404
Messages
6,124,715
Members
449,184
Latest member
COrmerod

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