Beste Excel forum leden,
Ik heb een macro opgenomen om gegevens van het web op te vragen.
Alleen krijg ik bij het uitvoeren van de macro een fout "Fout 1004"
Ik weet niet waarom ik de fout krijg?
Kan iemand mij helpen en de macro werkend krijgen?
Macro
[CODESub Importeren_gegevens()
'
' Importeren_gegevens Macro
' Importeerd gegevens van Web
'
' Sneltoets: CTRL+r
'
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:="http://www.detelefoongids.nl/bg/plaats-Nederland/w-loonbedrijf/1/?activeSort=sortname%7casc&local=false&nationalSearch=true®ionSearch=true&dominantCategoryIsLocal=false" _
, Destination:=Range("$A$1"))
.Name = _
"?activeSort=sortname%7casc&local=false®ionSearch=true&dominantCategoryIsLocal=false"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub][/CODE]
Alvast bedankt,
Nico
Ik heb een macro opgenomen om gegevens van het web op te vragen.
Alleen krijg ik bij het uitvoeren van de macro een fout "Fout 1004"
Ik weet niet waarom ik de fout krijg?
Kan iemand mij helpen en de macro werkend krijgen?
Macro
[CODESub Importeren_gegevens()
'
' Importeren_gegevens Macro
' Importeerd gegevens van Web
'
' Sneltoets: CTRL+r
'
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:="http://www.detelefoongids.nl/bg/plaats-Nederland/w-loonbedrijf/1/?activeSort=sortname%7casc&local=false&nationalSearch=true®ionSearch=true&dominantCategoryIsLocal=false" _
, Destination:=Range("$A$1"))
.Name = _
"?activeSort=sortname%7casc&local=false®ionSearch=true&dominantCategoryIsLocal=false"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub][/CODE]
Alvast bedankt,
Nico