Extract data from website

pksinghal

New Member
Joined
Apr 10, 2015
Messages
38
Hi

I need help from seniors.

I want to extract data from a website.


When i use option Data--->> From Web and then import it.

It doesn't import numeric value .


I also used VBA . but failed.

Function GetSpecificStockFuturesData(strName As String)

Dim c As Range
'Dim strName As String
Dim strConnString As Variant
Dim QT As QueryTable
On Error Resume Next
Dim wss As Worksheet
Dim wsd As Worksheet

If (TradingWindowOpen = False) Then

Worksheets("Main").Range("REFRESH_STATUS") = "NO Refresh between 9:00 AM and 9:20 AM"

Exit Function
End If

'clear all existing query tables
For Each QT In Worksheets("Data").QueryTables
QT.Delete
Next QT


strConnString = "url;NSE - National Stock Exchange of India Ltd."

Set QT = Worksheets("Data").QueryTables.Add(Connection:=strConnString, Destination:=Worksheets("Data").Range("$AH$1"))

With QT

.Name = strName & "_Futures"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = False
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.MaintainConnection = False

End With

'.Refresh BackgroundQuery:=False
QT.Refresh BackgroundQuery:=False

'clear all existing query tables
For Each QT In Worksheets("Data").QueryTables
QT.Delete
Next QT


End Function
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Do you have a Queries and connections pane on the right hand side?
 
Upvote 0
Hi Mark,

No I don't have queries.

If you just simply go to import this page

The data doesn't come.

Please check
 
Upvote 0
I am using Excel 2010.

Goto data menu--->>from web--- entered URL

Then click on options-->> disable date recognition and disable web query redirection.

Then click on import
 
Upvote 0
I'm not home (due to xmas) and so don't have access to my laptop with 2010 on it to try and extract with it.
Hopefully someone else will be able to jump in.
 
Upvote 0
I am afraid that I have had a quick try at downloading it with 2010 and get hashes where the data should be.
I will try and have another play with it when I can sit in front of laptop for a decent amount of time.
Please don't expect a quick response from me.
Hopefully someone else will spot something obvious.
 
Upvote 0

Forum statistics

Threads
1,215,633
Messages
6,125,928
Members
449,274
Latest member
mrcsbenson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top