+ Reply to Thread
Results 1 to 4 of 4

Thread: code for saving file from Internet Explore

  1. #1
    Forum Contributor
    Join Date
    03-28-2008
    Posts
    161

    code for saving file from Internet Explore

    Hi

    I have the below code which opens a web page, enter log in details, clicks a button 'Export to Excel'. Till here the codes works fine, now I want just a line to save the file in C drive.
    Sub Web_Top_Login1()
    
    Dim IE As Object
    'Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    '(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    'Dim sFName
    
    Set myIE = CreateObject("InternetExplorer.Application")
     myIE.Visible = True
       With myIE
    .Navigate "http://test.com" ' Actual site name is changed due to security reason
    
        Do While .Busy: DoEvents: Loop
        Do While .readyState <> 4: DoEvents: Loop
        .Visible = True    
        With .Document.forms("ReportsSearch_0")
        .date_date.Value = "11-May-2011"
        .ReportsSearch_Button_0.Click   
       Do While myIE.Busy: DoEvents: Loop
        'Click 'Export to Excel
        myIE.Document.forms("ReportsSearch_0").ReportsSearch_Button_4.Click
       
       End With
    End With
    End Sub
    the above codes works fine for me. but after the click, i get a dialogue box saying
    "File Download - Security Warning "Do you want to save this file, or find a program only to open it?"

    I need a code to click save and the file has to be saved in C:/MyDocuments folder

    Can you guys help me...
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: code for saving file from Internet Explore

    What is the format of the file you're downloading? An Excel spreadsheet? A text file?

    And what format do you want it saved as? The same as above?

    Dion

  3. #3
    Forum Contributor
    Join Date
    03-28-2008
    Posts
    161

    Re: code for saving file from Internet Explore

    Thanks,

    Its a an excel file, i want to save as excel

  4. #4
    Forum Contributor
    Join Date
    03-28-2008
    Posts
    161

    Re: code for saving file from Internet Explore

    Can someone help me on this?

+ Reply to Thread

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.2.0