Erreur d'execution 1004

Résolu/Fermé
gorfeatice Messages postés 2 Date d'inscription samedi 21 novembre 2015 Statut Membre Dernière intervention 22 novembre 2015 - 21 nov. 2015 à 20:29
gorfeatice Messages postés 2 Date d'inscription samedi 21 novembre 2015 Statut Membre Dernière intervention 22 novembre 2015 - 22 nov. 2015 à 17:27
Bonjour à tous,

J'aurais besoin d'un petit coup de main concernant la macro suivante :

Sub Stock_cbdd()

mycbd = [S3]
Mypartial = [S5]

Dim wkb As Workbook
Set wkb = Workbooks.Open("C:\stocks.xlsx")

Stock = Application.WorksheetFunction.SumIfs(wkb.Worksheets("wms_browse").Range("G2:G2056"), _
wkb.Worksheets("wms_browse").Range("D2:D2056"), mycbd, wkb.Worksheets("wms_browse").Range("N2:N2056"), "=" & Mypartial)

[T3] = Stock

End Sub


MESSAGE ERREUR :

Erreur d'execution 1004.
C:\stocks.xlsx introuvable. Verifiez l'orthographe du nom du classeur et la validité de l'emplacement.

J'ai verifié que c'etait bien un xslx, l'emplacement..je ne vois pas du tout :(

Merci à vous par avance !

1 réponse

michel_m Messages postés 16603 Date d'inscription lundi 12 septembre 2005 Statut Contributeur Dernière intervention 16 décembre 2023 3 303
22 nov. 2015 à 06:33
Bonjour,

Dim wkb As Workbook
wkb = Workbooks.Open Filename:= "C:\stocks.xlsx"

0
gorfeatice Messages postés 2 Date d'inscription samedi 21 novembre 2015 Statut Membre Dernière intervention 22 novembre 2015
22 nov. 2015 à 17:27
Merci beaucoup Michel d'avoir pris le temps de me répondre.! Ca fonctionne.
0