VBA Probleme "Nombre d'argt incorrect ou affectation de propriété incorrect"
Bonjour, mon problème est le suivant : je fais une fonction qui me permet de me donner le chemin d'accès à un fichier/dossier en fonction del'argument qu'on donne à la fonction : voici le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Function path_file(ByVal path)
Set path = New Collection
path.Add "D:\Téléchargements\CreationCV\CreationCV\Sources", "cv_source"
path.Add "D:\Téléchargements\CreationCV\CreationCV\", "creation_cv"
path.Add "D:\Téléchargements\CreationCV\CreationCV\Sauvergardes_chrono", "save_chrono"
path.Add "D:\Téléchargements\CreationCV\CreationCV\Sauvergardes_chrono\Chrono.xls", "save_chrono.xls"
path.Add "D:\Téléchargements\CreationCV\CreationCV\Sources\Chrono2018.xls", "chrono2018"
path.Add "D:\Téléchargements\CreationCV\CreationCV\Sources\Chrono.xls", "chrono"
path.Add "D:\Téléchargements\CreationCV\CreationCV\CV_pdf", "cv_pdf"
path.Add "D:\Téléchargements\CreationCV\Etiquettes\Base dates.xls", "base_dates"
path.Add "D:\Téléchargements\CreationCV\CreationCV\Sources\Ariane.xls", "ariane.xls"
path.Add "D:\Téléchargements\CreationCV\CreationCV\Importer dans DECA.xlsm", "import_deca"
path_file = path
End Function
Sub test()
path_file (cv_source)
End Sub |
Lors de l'éxecution j'ai le mesdsage d'erreur inscrit dans le titre, je ne comprends pas la fonction a un seul argument et je l'appel avec un seul argument pouvez-vous m'aider ?