LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default reading password-protected, open webpage

Works great

Thanks again Tom

----- Tom Ogilvy wrote: ----

try just deleting the IE.Visible line

Since it is already open and visible, no reason to do anything with it

In any event (alreayd open or being opened by your code), you should be abl
to bring Excel back to the top wit

AppActivate Application.Captio

--
Regards
Tom Ogilv

"Kevin" wrote in messag
..
Thanks Tom
Your Tester 1 code works like a charm. But I want to keep the Exce

window up front
So I made several changes
Sub Tester2(

Dim IE As Objec
Dim sHTML As Strin
On Error Resume Nex
Set IE = GetObject(, "InternetExplorer.Application"
sHTML = IE.Document.Documentelement.innerTex
IE.Visible = Fals
If sHTML = "" The
MsgBox "Webpage was not open!
Exit Su
End I
Set IE = Nothin
' use sHTM
End Su
Thanks again Tom

----- Tom Ogilvy wrote: ----
In a previous post by Jake Marx, he showed a different syntax fo

InnerTex
Sub Demo(

Dim ie As Objec
Dim nFile As Intege
Set ie = CreateObject("InternetExplorer.Application"
With i

.Visible = Fals
.Silent = Tru
.Navigate "www.yahoo.com
Do Until Not .Bus
DoEvent
Loo
nFile = FreeFil
Open "D:\yahoo.txt" For Output Shared As #nFil
Print #nFile, .Document.DocumentElement.InnerTex
Close #nFil
.Qui
End Wit
Set ie = Nothin
End Su
Using .Document.DocumentElement.InnerTex

This did work for me with an open page in I
Sub Tester1(

Dim IE As Objec
Dim sHTML As Strin
Set IE = GetObject(, "InternetExplorer.Application"
IE.Visible = Tru
sHTML = IE.Document.Documentelement.innerTex
Debug.Print sHTM
Set IE = Nothin
End Su
-

Regards
Tom Ogilv
Kevin wrote in messag

..
Thanks Tom
In my attempts to execute the following code (NOTE: the webpage

want t
read from is already open)
Dim IE As Objec

Dim sHTML As Strin
Set IE = GetObject(, "InternetExplorer.Application"
IE.Visible = Tru
sHTML = IE.Document.Body.innerTex
I get the following error when the program reaches the last line
Run-time error '-2147467259 (80004005)'

Method 'Document' of object 'IWebBrowser2' faile
Kevi
----- Tom Ogilvy wrote: ----
Can you use GetObject to get the already open instance of I

and the
us
document.body.InnerText
-

Regards
Tom Ogilv
Kevin wrote in messag

..
I monitor the performance of my 401(k) by downloading prices fro

yahoo.com, using VBA of course. This has become a dail

routine
With fun
prices and number of shares per fund I can determine th

dollar valu
o
each fund (i.e., current balance). Problem is, the number o

share
pe
fund is not something I can download using VBA. This i

because the
fund
manager's website is password-protected.
Is it possible to read from an open webpage? If I were to

establish the
target html in a separate IE window, can I use VBA code to

read from
it?
That is, rather than navigating to the URL and using
CreateObject("InternetExplorer.Application").Docum ent.Body.innerText
Thanks.
Kevin

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PAssword protected file will not open jetta878 Excel Discussion (Misc queries) 9 January 7th 09 06:17 PM
Make Workbook Password protected tp open Stockwell43 Excel Discussion (Misc queries) 4 July 2nd 08 12:44 AM
How to delete a password in a protected file that you can't open? lostinspace Excel Discussion (Misc queries) 1 April 30th 08 06:39 PM
Cannot open password-protected Excel File Sumit Excel Discussion (Misc queries) 0 March 6th 08 09:41 AM
open Access DB that is password protected Shin[_2_] Excel Programming 1 November 20th 03 12:41 PM


All times are GMT +1. The time now is 11:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"