Hi! Siva,
I needed your help with the web query...
I needed your help with the web query...
Hmmm... yahoo is not giving any table-name or table-id property, so you will not get it by looking at "View Source", then you have to refer to it by absolute terms, by counting the number of table references in the source-code OR you may use excel for that.
About new web-query, you may find little difficulty in getting the table-ref properly, eventhough a one time activity. Either you may use the "View Source" option of your web-browser, and find the "table-name/table-id" in the source..... OR you may use the excel to record a macro, for a webquery to your target web address and check the "WebTables" property inthe macro code..( Excel => Data Menu=> Import External Data => New Web Query... ), this is the office 2003 menu option, may be slight changes in other versions.
Code:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;[COLOR="blue"][B]http://in.finance.yahoo.com/p?v&k=pf_4[/B][/COLOR]", Destination:=Range("A1"))
.Name = "p?v&k=pf_4"
.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
[B][COLOR="Blue"].WebTables = "16"[/COLOR][/B]
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
In yStock, to configure the above i will input
Web Address as, http://in.finance.yahoo.com/p?v&k=pf_4
Table Ref. as, 16
But in your case, i think it is ...
Web Address as, http://in.finance.yahoo.com/p?v&k=pf_3
Table Ref as, 21
Check it out.
Thanks & Regards
Siva