I can use userid and passwd to auto login a web site by using the following VBA codes.
After that, there are many files on this web page.
File12012006.txt
File12022006.txt
I can't find the web path (http for the file. When I click on the txt file, it will open as a txt file with no path.
How should I save this file to my C: drive by using VBA?
Thank you.
Sub Main()
Dim objIE As Object
Dim strWebSite As String
Dim intReadyState As Integer
Set objIE = CreateObject("InternetExplorer.Application")
strWebSite = "http://www.sss.com"
objIE.Visible = 1
objIE.Navigate strWebSite
Do While Not intReadyState = 4
intReadyState = objIE.ReadyState
Loop
Set ipf = objIE.Document.all.Item("txtUsername")
ipf.Value = "XXX"
Set ipf = objIE.Document.all.Item("txtPassword")
ipf.Value = "XXX"
Set ipf = objIE.Document.all.Item("cmdOK")
ipf.Click
'ipf.Submit
End Sub
After that, there are many files on this web page.
File12012006.txt
File12022006.txt
I can't find the web path (http for the file. When I click on the txt file, it will open as a txt file with no path.
How should I save this file to my C: drive by using VBA?
Thank you.
Sub Main()
Dim objIE As Object
Dim strWebSite As String
Dim intReadyState As Integer
Set objIE = CreateObject("InternetExplorer.Application")
strWebSite = "http://www.sss.com"
objIE.Visible = 1
objIE.Navigate strWebSite
Do While Not intReadyState = 4
intReadyState = objIE.ReadyState
Loop
Set ipf = objIE.Document.all.Item("txtUsername")
ipf.Value = "XXX"
Set ipf = objIE.Document.all.Item("txtPassword")
ipf.Value = "XXX"
Set ipf = objIE.Document.all.Item("cmdOK")
ipf.Click
'ipf.Submit
End Sub