Erreur 91 sur un web query

Fermé
LeGhe - 26 mars 2019 à 17:22
yg_be Messages postés 22717 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 22 avril 2024 - 26 mars 2019 à 19:14
Bonjour,

Je cherche à récupérer les prix français d'une série d'articles en import, mais je chope une erreur 91 que je ne comprends pas...

Ma feuille :
Colonne A : liste d'ISBN
Colonne B : vide, en attente de prix

Mon code :
Sub NOSTROMO()
    Dim ISBN As String
    Derlig = Sheets("EXPORT").Range("D" & Rows.Count).End(xlUp).Row
    For compteur = 2 To Derlig
        ISBN = Sheets("EXPORT").Cells(compteur, 1)
        Sheets("TEMP").Cells.Clear
        Application.CutCopyMode = False
        With Sheets("TEMP").QueryTables.Add(Connection:="URL;https://nostromoweb.fr/fr/recherche/?keywords=" & ISBN & "&type=global" _
            , Destination:=Sheets("TEMP").Range("$A$1"))
            .Name = ISBN
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = False
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .WebSelectionType = xlEntirePage
            .WebFormatting = xlWebFormattingAll
            .WebPreFormattedTextToColumns = True
            .WebConsecutiveDelimitersAsOne = True
            .WebSingleBlockTextImport = False
            .WebDisableDateRecognition = False
            .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
        End With
        With Sheets("TEMP")
            Set Col_A = .Range("A2:A" & .Range("A" & Rows.Count).End(xlUp).Row)
            PRIX = Application.CountIf(Col_A, "*TTC*")
            If PRIX > 0 Then
                Lig = 1
                Lig = .Columns("A").Find("PRIX", .Cells(Lig, "A"), , xlPart).Row
                
                Sheets("EXPORT").Cells(compteur, 2) = Sheets("TEMP").Cells(Lig, 1).Value
                Sheets("EXPORT").Cells(compteur, 2).Interior.ColorIndex = 4
            Else
                Sheets("EXPORT").Cells(compteur, 2) = "inconnu"
                Sheets("EXPORT").Cells(compteur, 2).Interior.ColorIndex = 3
            End If
        End With
    Next
End Sub



Merci à la communauté de m'éclairer sur mon erreur !

Configuration: Windows / Firefox 66.0
A voir également:

1 réponse

yg_be Messages postés 22717 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 22 avril 2024 1 476
26 mars 2019 à 19:14
bonjour, je pense que tu devrais nous décrire plus précisément le contenu de tes feuilles.
0