I started a thread entitled "Dynamic web query". That is working well except for one issue. Some parts for a certain vendor do not display correctly. I ran macros in an attempt to determine why. Although the eventual data returned is correct, the data pasted into my spreadsheet is not. While running the query, the two parts which failed did not go directly to the page I needed. The one that worked did. This is the query -
I cannot help to notice that the one's that failed have a number in the .Name field. Any help would be appreciated! Happy Thanksgiving everyone and thanks for the great tips I have received so far!
Code:
Sub Macro1()
'
' Macro1 Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.digikey.com/product-detail/en/LT1761ES5-BYP%23TRPBF/LT1761ES5-BYP%23TRPBFCT-ND/4694469" _
, Destination:=Range("$A$1"))
.Name = "4694469"
.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 = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
Sub Macro2()
'
' Macro2 Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.digikey.com/product-search/en?stock=1&keywords=LT3085IMS8E#PBF-ND" _
, Destination:=Range("$A$15"))
.Name = "en?stock=1&keywords=LT3085IMS8E#PBF-ND"
.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 = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Range("B3").Select
Windows("DK BOM.xlsm").Activate
Range("F82").Select
ActiveCell.FormulaR1C1 = "LT6654AHS6-5#TRMPBFCT-ND"
Windows("Book1").Activate
Range("A30").Select
End Sub
Sub Macro3()
'
' Macro3 Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.digikey.com/product-detail/en/LT6654AHS6-5%23TRMPBF/LT6654AHS6-5%23TRMPBFCT-ND/2485841" _
, Destination:=Range("$A$30"))
.Name = "2485841"
.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 = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
I cannot help to notice that the one's that failed have a number in the .Name field. Any help would be appreciated! Happy Thanksgiving everyone and thanks for the great tips I have received so far!