Sunday, May 17, 2009

Web Query / Web import query

Sub import_web()

   With ActiveSheet.QueryTables.Add(Connection:= _
       "TEXT;http://www.nseindia.com/content/historical/DERIVATIVES/
2009/MAY/fo06MAY2009bhav.csv
" _
       , Destination:=Range("A1"))
       .Name = "fo06MAY2009bhav_1"
       .FieldNames = True
       .RowNumbers = False
       .FillAdjacentFormulas = False
       .PreserveFormatting = True
       .RefreshOnFileOpen = False
       .RefreshStyle = xlInsertDeleteCells
       .SavePassword = False
       .SaveData = True
       .AdjustColumnWidth = True
       .RefreshPeriod = 0
       .TextFilePromptOnRefresh = False
       .TextFilePlatform = 437
       .TextFileStartRow = 1
       .TextFileParseType = xlDelimited
       .TextFileTextQualifier = xlTextQualifierDoubleQuote
       .TextFileConsecutiveDelimiter = False
       .TextFileTabDelimiter = True
       .TextFileSemicolonDelimiter = False
       .TextFileCommaDelimiter = True
       .TextFileSpaceDelimiter = False
       .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1)
       .TextFileTrailingMinusNumbers = True
       .Refresh BackgroundQuery:=False
   End With
End Sub


Explore and discover exciting holidays and getaways with Yahoo! India Travel Click here!

No comments:

Post a Comment