Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default 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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web query..... unable to get data ? Vijay Kotian Excel Discussion (Misc queries) 2 April 17th 09 02:00 PM
Unable extract data from WEB query Vijay Kotian Excel Programming 2 September 12th 07 06:34 AM
Extract Data using Web query [email protected] Excel Programming 5 December 16th 06 08:56 AM
Data extract from access query TrevorM Excel Discussion (Misc queries) 4 September 23rd 05 09:29 AM
Using Microsoft Query to Extract Data Jim Wallace Excel Programming 1 October 20th 03 11:30 PM


All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"