ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Web query - unable to extract data (https://www.excelbanter.com/excel-programming/427069-web-query-unable-extract-data.html)

Vijay Kotian

Web query - unable to extract data
 
Hi,

I have recorded a macro through which i would like to extract data from web
but unable to do so. Can someone help me.

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.




Nigel[_2_]

Web query - unable to extract data
 
When you say recorded, you must have actually gone through the process to
extract data, did that work?

--

Regards,
Nigel




"Vijay Kotian" wrote in message
...
Hi,

I have recorded a macro through which i would like to extract data from
web
but unable to do so. Can someone help me.

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.





Vijay Kotian

Web query - unable to extract data
 
I am not getting data, is there any way to get data from web directly to
excel with help of macro or any other mode.

"Nigel" wrote:

When you say recorded, you must have actually gone through the process to
extract data, did that work?

--

Regards,
Nigel




"Vijay Kotian" wrote in message
...
Hi,

I have recorded a macro through which i would like to extract data from
web
but unable to do so. Can someone help me.

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.






[email protected]

Web query - unable to extract data
 
On Apr 17, 7:06*am, Vijay Kotian
wrote:
I am not getting data, is there any way to get data from web directly to
excel with help of macro or any other mode.



"Nigel" wrote:
When you say recorded, you must have actually gone through the process to
extract data, did that work?


--


Regards,
Nigel


"Vijay Kotian" wrote in message
...
Hi,


I have recorded a macro through which i would like to extract data from
web
but unable to do so. *Can someone help me.


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.- Hide quoted text -


- Show quoted text -


Either of the following approaches pastes the web data into my
activesheet...Ron


Sub test1()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.bseindia.com/mktlive/market_summ/
categorywise_turnover.asp", _
Destination:=Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

------------------------------------------------------------------------------

Sub test2()
Set ie = CreateObject("InternetExplorer.Application")

With ie
.Visible = True
.Navigate "http://www.bseindia.com/mktlive/market_summ/
categorywise_turnover.asp"
.Top = 50
.Left = 530
.Height = 400
.Width = 400

' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop

End With

' copy and paste
ie.ExecWB 17, 2
ie.ExecWB 12, 0
ActiveSheet.PasteSpecial Format:="Text", Link:=False,
DisplayAsIcon:=False
End Sub


All times are GMT +1. The time now is 05:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com