Is there a VB.NET (1.1 or 2.0) equivalent for Excel's
[Data>ImportData>WebQuery]?
Below is a copy of an example of the Excel VBA that I have been using to
pull some data off a webpage. I've got a couple of simple application that
currently live in an Excel workbook as VBA solely for this one function.
I'd like to move this to a VB.NET Windows form application that does not
rely on Excel.
Example of Excel VBA:
Sub GetData()
With ActiveSheet.QueryTables.Add(Connection:="URL; _
http://www.microsoft.com", Destination:=Range("A1"))
.Name = "www.microsoft"
.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 = """nTable"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub