Bonjour et merci pour tout votre aide
Information :
- dans la feuille (P associer arret) cliquer sur le bouton (Chercher le plan de l'article)
- un UserForm8 s’affiche écrire moteur ou 555 dans TextBox2
- Problématique : trouver le fichier pdf s'il existe dans ThisWorkbook.Path & "\Article et RDA\"
module cherché un fichier
Objectif :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 Public Function FichierExiste(MonFichier As String) 'par Excel-Malin.com ( http://excel-malin.com ) If Len(Dir(MonFichier)) > 0 Then FichierExiste = True Else FichierExiste = False End If End Function
- avec CommandButton16 (Voir plan article) je voudrai chercher le fichier pdf dans le dossier ThisWorkbook.Path & "\Article et RDA\" et l’ouvrir
il me manque la moitié du code
Merci encore et bonne continuation
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Private Sub CommandButton16_Click() Dim MonFichier As String Dim yourmsgbox As Integer MonFichier = ThisWorkbook.Path & "\Article et RDA\" & TextBox7.Text & " " & "Article" & " " & TextBox8.Text & " " & "Rep" & " " & TextBox10.Text & ".pdf" If FichierExiste(MonFichier) = False Then yourmsgbox = MsgBox("Fichier inexistant, voulez vous joindre un fichier pdf", vbOKCancel, "confirmation") If yourmsgbox = vbOK Then MonFichier = Application.GetOpenFilename(",*.pdf") FileCopy MonFichier, ThisWorkbook.Path & "\Article et RDA\" & TextBox7.Text & " " & "Article" & " " & TextBox8.Text & " " & "Rep" & " " & TextBox10.Text & ".pdf" Else 'open 'show 'MonFichier , ThisWorkbook.Path & "\Article et RDA\" & TextBox7.Text & " " & "Article" & " " & TextBox8.Text & " " & "Rep" & " " & TextBox10.Text & ".pdf" End If End If End Sub
Partager