Results 1 to 4 of 4

code for saving file from Internet Explore

Threaded View

aravindhan_31 code for saving file from... 05-12-2011, 11:30 AM
mojo249 Re: code for saving file from... 05-12-2011, 06:36 PM
aravindhan_31 Re: code for saving file from... 05-13-2011, 03:33 AM
aravindhan_31 Re: code for saving file from... 05-17-2011, 07:06 AM
  1. #1
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    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

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