Hi,
I have a task that involves opening links in Chrome then copying and pasting the entire page into Excel (I won't bore you with what happens then, it's this particular part I'm struggling to automate).
I've managed to get Excel to open hyperlinks easy enough (so in simple terms I'll have a list of hyperlinks that it'll go down one by one and open up) but after that I'm stuck. All I'm needing it to do is replace a human going CTRL+A and then CTRL+C on the webpage that has opened up (everything after that works fine), but I can't figure out how. I've even tried just doing SendKeys but that doesn't seem to work. Here's the relevant part of my current code:
It opens the hyperlink, waits a few seconds and then in theory it should select all then copy the webpage I'm now looking at - but it neither selects all nor copies anything to the clipboard. Is there something I'm doing wrong there, or a better way to do this? I can't install anything extra on the machines that'll be doing this.
Any help would be greatly appreciated.
I have a task that involves opening links in Chrome then copying and pasting the entire page into Excel (I won't bore you with what happens then, it's this particular part I'm struggling to automate).
I've managed to get Excel to open hyperlinks easy enough (so in simple terms I'll have a list of hyperlinks that it'll go down one by one and open up) but after that I'm stuck. All I'm needing it to do is replace a human going CTRL+A and then CTRL+C on the webpage that has opened up (everything after that works fine), but I can't figure out how. I've even tried just doing SendKeys but that doesn't seem to work. Here's the relevant part of my current code:
VBA Code:
mycell.Hyperlinks(1).Follow NewWindow:=False
Application.Wait (Now() + TimeValue("00:00:05"))
SendKeys "^{A}"
SendKeys "^{C}"
It opens the hyperlink, waits a few seconds and then in theory it should select all then copy the webpage I'm now looking at - but it neither selects all nor copies anything to the clipboard. Is there something I'm doing wrong there, or a better way to do this? I can't install anything extra on the machines that'll be doing this.
Any help would be greatly appreciated.