ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with a simple problem (https://www.excelbanter.com/excel-programming/286742-need-help-simple-problem.html)

Gary[_13_]

Need help with a simple problem
 
I need some help controlling IE(6) from Excel(2003).

All I want to do(via Excel VB) is:

1. Open a URL with IE. (Via URL or hyperlink in a cell, sheet has both)

2. Save as a .MHT or .TXT file for further processing.

3. Close IE.

Can some kind soul out there throw me a code snippet or two?


Nigel[_8_]

Need help with a simple problem
 
Gary,
Here is one example which you can modify to suit........
set up the navigate text string which could be cell contents or any other
text
use the IE DOM to select the parts of the pages you require, here I use the
body.innertext.

Cheers
N


Sub GetUrl()
Dim ie As Object
Dim s As String

Set ie = CreateObject("InternetExplorer.Application")

With ie
.Navigate "http://www.etc.etc"
Do Until Not .Busy And .ReadyState = 4
DoEvents
Loop

s = ie.Document.body.innertext 's now contains content of
webpage
.Quit
End With
Set ie = Nothing


"Gary" wrote in message
6...
I need some help controlling IE(6) from Excel(2003).

All I want to do(via Excel VB) is:

1. Open a URL with IE. (Via URL or hyperlink in a cell, sheet has both)

2. Save as a .MHT or .TXT file for further processing.

3. Close IE.

Can some kind soul out there throw me a code snippet or two?





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Gary King

Need help with a simple problem
 
Thanks Nigel, that gets me part of the way there.

Any idea how to do a <File<Save As in IE?

"Nigel" wrote in
:

Gary,
Here is one example which you can modify to suit........
set up the navigate text string which could be cell contents or any
other text
use the IE DOM to select the parts of the pages you require, here I
use the body.innertext.

Cheers
N


Sub GetUrl()
Dim ie As Object
Dim s As String

Set ie = CreateObject("InternetExplorer.Application")

With ie
.Navigate "http://www.etc.etc"
Do Until Not .Busy And .ReadyState = 4
DoEvents
Loop

s = ie.Document.body.innertext 's now contains content of
webpage
.Quit
End With
Set ie = Nothing


"Gary" wrote in message
6...
I need some help controlling IE(6) from Excel(2003).

All I want to do(via Excel VB) is:

1. Open a URL with IE. (Via URL or hyperlink in a cell, sheet has
both)

2. Save as a .MHT or .TXT file for further processing.

3. Close IE.

Can some kind soul out there throw me a code snippet or two?





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==---- http://www.newsfeed.com The #1 Newsgroup Service in the
World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers
- Total Privacy via Encryption =---




All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com