Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
PAssword protected file will not open | Excel Discussion (Misc queries) | |||
Make Workbook Password protected tp open | Excel Discussion (Misc queries) | |||
How to delete a password in a protected file that you can't open? | Excel Discussion (Misc queries) | |||
Cannot open password-protected Excel File | Excel Discussion (Misc queries) | |||
open Access DB that is password protected | Excel Programming |