d0o0n7
Board Regular
- Joined
- Aug 12, 2008
- Messages
- 53
Hi,
I want to save a file from internet but after hitting download i am getting a popup window and i am unable to activate and save that file (.xls) through VBA code. I Want to download that in My Document and then want to rename it.. Please have a look at my coding.. and add yours...
------------------------------------------------------------------
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Sub Login_2_Website()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "http://www.anysite.com"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
HTMLDoc.all.camusername.Value = "myid"
HTMLDoc.all.campassword.Value = "password"
SendKeys "{ENTER}", True
"here my logic is missing" "Need Help"
Err_Clear:
If Err <> 0 Then
Resume Next
End If
End Sub
--------------------------------------------------------------
Thanks in advance
Dev
I want to save a file from internet but after hitting download i am getting a popup window and i am unable to activate and save that file (.xls) through VBA code. I Want to download that in My Document and then want to rename it.. Please have a look at my coding.. and add yours...
------------------------------------------------------------------
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Sub Login_2_Website()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "http://www.anysite.com"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
HTMLDoc.all.camusername.Value = "myid"
HTMLDoc.all.campassword.Value = "password"
SendKeys "{ENTER}", True
"here my logic is missing" "Need Help"
Err_Clear:
If Err <> 0 Then
Resume Next
End If
End Sub
--------------------------------------------------------------
Thanks in advance
Dev