Automating Internet Explorer

L

Laura

I have this lovely code I got from The Access Web (Thanks Dev!):

Sub TestHTTP()
On Error GoTo ErrHandler
Dim objHTTP As HTTP
Const conTARGET =
"http://www.company.com/cvd/Group/GroupProfile.aspx?grp=01130&sys=1"

Set objHTTP = New HTTP
With objHTTP
.HttpURL = conTARGET
.DestinationFile = "c:\temp\test1.htm"
.PromptWithCommonDialog = False
If .FileExists Then .OverwriteTarget = True
If Not .IsConnected Then .DialDefaultNumber
.ConnectToHTTPHost
.WriteHTTPDataToFile
End With
ExitHere:
On Error Resume Next
Set objHTTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
Exit Sub
ErrHandler:
MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly,
Err.Source
Resume ExitHere
End Sub


This is a website that I have to login to. So, where it says

Set objHTTP = New HTTP

I need it to use the open Internet Explorer window, not create a new one. I
get a 'You are not logged in' error everytime.

I have tried
Set objHTTP = Current HTTP
Set objHTTP = Existing HTTP
etc to no avail.

I have 407 internet pages to download and parse in Excel.

Any help is greatly appreciated!

Thanks!
Laura
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top