Hello...
I'm trying to copy a webpage and paste it to a worksheet. I'm using some standard code that I've used successfully a few times before but in this case it's not working. Basically what's happening is that I'm navigating the the webside just fine but the copy function isn't working.
I've stopped the code on the "IE.ExecWB 17, 0" step (see below), clicked on the webpage and then continued on with the code... This actually works to import the data from the webpage to the clipboard. I'm not sure why the page isn't getting automatically selected. Any suggestions.
I'm trying to copy a webpage and paste it to a worksheet. I'm using some standard code that I've used successfully a few times before but in this case it's not working. Basically what's happening is that I'm navigating the the webside just fine but the copy function isn't working.
I've stopped the code on the "IE.ExecWB 17, 0" step (see below), clicked on the webpage and then continued on with the code... This actually works to import the data from the webpage to the clipboard. I'm not sure why the page isn't getting automatically selected. Any suggestions.
Code:
IE.Navigate theURL
IE.Visible = True
While IE.Busy
DoEvents
Wend
Application.Wait DateAdd("s", Wait_Time, Now)
IE.ExecWB 17, 0 '// SelectAll
IE.ExecWB 12, 2 '// Copy selection
ActiveSheet.PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False