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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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,223,719
Messages
6,174,089
Members
452,542
Latest member
Bricklin

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