Hi Team,

Objective: To extract data from an Intranet page to excel daily.

Issue : The data in the website is within a frame, hence its giving me an error if I try with Excel ready made option (DATA > from web) or using a crawler. Even the code above gives me the same issue.

Note: the URL signified in the below code is just an example and not the actual URL as its confidential. The intranet site requires a username and password to login.

I tried using lot of webcrawlers, which didn't work. Hence I created a macro as shown below.

Sub Basic_Web_Query()

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.xyz.com; token=C2639C63E99F18EF1C93FA48B46F84D4&&userName=abc", Destination:=Range("$A$1"))
.Name = "vinodn"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1,2,3"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

End Sub

Kindly assist please.