Open browser, copy text

wut

Banned
Joined
Dec 13, 2010
Messages
229
I use this code to open my browser window.

Code:
Dim Browser As Object
Set Browser = CreateObject("InternetExplorer.Application")
link = "http://link.com"
Browser.navigate (link)
Browser.Visible = True

How do I select the contents of the webpage and copy them?

Is there a list of commands like that anywhere that can be used with other applications? I tried sendkeys and it wouldn't work. I found something about this the other day on ozgrid but I can't find it again.
 
is the value of link as it appears in the code? if it is, it most not contain .... etc
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hello wut,

When I try the link, I get the following error message:
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.


Sincerely,
Leith Ross
 
Upvote 0
I actually didn't intend to post the link. It's only accessible via company intranet. I'm just wondering about that range thing. Shouldn't that select method be working to choose where I want the copied information to be pasted?

Edit: Because that's where it fails. It loads the site fine, it just fails once it tries to select a specific range. I want to do this multiple times with multiple pages, so I need to be able to choose where on the sheet I'm pasting.
 
Upvote 0
@ Norie: I'm disgusted because there's two options available to me. I can either fail with a billion obvious combinations like the ones I posted before ("browser.copy"), or I can come here and ask somebody to just do it for me. There's no in-between option that actually results in me learning anything useful so that the next time I don't have to come here and beg somebody to do my work for me.

That pisses me off.

Why should there be a simple 'command' to do what you want?

What, it should be complicated...? It's visual basic.
 
Upvote 0
Yeah, activate fails in that instance too. That makes no sense to me at all.

Code:
Browser.ExecWB 17, 0
Browser.ExecWB 12, 0
Browser.Quit
ThisWorkbook.Activate
Sheets("test").Activate
[B]   Range("A1").Activate[/B]
Sheets("test").Paste

Indented line fails. Fails with "select" in place of "activate" too. This command works just fine when I use it anywhere else.

What's up with that?
 
Upvote 0
is the worksheet protected by any chance?
 
Upvote 0
just a word on your complaint: i think your gripe about arcane commands is valid and it does make it hard to learn without help, which is why all of us are here. there are, more often than not, gurus in particular areas and the trick is, when you prepare to sail into something complete alien, look around for one somewhere on the net and have a bit of a look at how its done. at least things arent quite so frustrating.

i found this which might help a little

http://www.vbforums.com/showthread.php?t=384076
 
Upvote 0
Your link looks like it’s got a lot of great resources for manipulating your browser in a bunch of simple ways. I lost my way to a page on ozgrid that was really similar.
<o:p></o:p>
Now I’m just trying to figure out this “Range(“XY”).Select” issue. Try out the code with any valid URL, and you’ll see exactly what I’m talking about. It fails with a message that says select method of range class failed.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
But that line of the code works just fine on its own.
 
Upvote 0
And, even more importantly, the link you posted explains exactly how to carry out the instructions Leith posted earlier (which read like Greek to me).
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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