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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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