Results 1 to 8 of 8

Macro to Open webpage, then save webpage as txt file.

Threaded View

  1. #1
    Registered User
    Join Date
    08-20-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    45

    Macro to Open webpage, then save webpage as txt file.

    Hi,

    I have the following code which opens a webpage from Excel and then waits until it finishes loading and that is how far I have got...

    Sub IE_saveastext()
        Dim ie As InternetExplorer
       
        Set ie = New InternetExplorer
         
        ie.Navigate "http://www.google.com" 'google as an example
        ie.Visible = True
         
         ' Loop until ie page is fully loaded
        Do Until ie.ReadyState = READYSTATE_COMPLETE
            DoEvents
        Loop
        
        ' code to save webpage as text file here
        
        ie.Quit
    
        Set ie = Nothing
    End Sub
    The next stage is that I am wanting it to save the webpage as a text file:
    (From IE window (File->Save As->......Save As Type-> Text File *.txt) with a file name which is located in say cell A1 in the workbook.

    I would just import it into Excel and do it that way however there is quite a lot of data.

    Is this possible?

    I have attached an example txt file of what I am looking for if it was done for google.com.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1