Web query..... unable to get data ?

V

Vijay Kotian

Can someone help me out to extract data through web query.


With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://www.bseindia.com/mktlive/market_summ/categorywise_turnover.asp", _
Destination:=Range("A1"))
.Name = "categorywise_turnover"
.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 = "8"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Thank you.
 
D

Don Guillett

Change to 7,8. Also, after established,just use this to refresh. Comment out
or delete unnecessary lines of code

sub refresh()
With ActiveSheet.QueryTables(1)
.Connection = _
"URL;http://www.bseindia.com/mktlive/market_summ/categorywise_turnover.asp"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "7,8"
'---------------
'.WebPreFormattedTextToColumns = True
'.WebConsecutiveDelimitersAsOne = True
'.WebSingleBlockTextImport = False
'.WebDisableDateRecognition = False
'.WebDisableRedirections = False
'============
.Refresh BackgroundQuery:=False
End With
end sub
 

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