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
I need help from seniors.
I want to extract data from a website.
NSE - National Stock Exchange of India Ltd.
nseindia.com
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