Hi everyone!

I have some VBA code that I found online which I want to use to pull data from a web page into excel.
My problem is that the webpage has Username Password authentication. Whenever I run the piece of code (see below) it will only pull the text from that login page.

I have tried using:
"http://myusername:[email protected]/staff/index.php?/Reports/Report/Generate/693"
and
"http://support.mycompany.com/staff/index.php?/Reports/Report/Generate/693?uname=myusername&pwd=mypassword"

Any ideas where I'm going wrong.

This is the code that I am using:

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://mycompany.com/staff/index.php?/Reports/Report/Generate/693" _
, Destination:=Range("$D$5"))
.Name = _
"/Reports/Report/Generate/693"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With



Any ideas where I'm going wrong?