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