la fonction FileCopy avec ThisWorkbook.Path
Bonjour, et merci d’avance pour l’efforce que vous faite pour nous les nuls
Je voudrai attribuer a ma CommandButton19_Click , un code qui me permettrait d’ouvrir une fenêtre parcourir et choisir une photo dans mon ordi, et l’enregistrer dans mon répertoire ( ThisWorkbook.Path & "\Information\Photos\Userform"), la photos doit être nommé comme la TextBox14.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Private Sub CommandButton19_Click()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
If .Show = -1 Then
'FileCopy .SelectedItems(1), Application.CurrentProject.Path & "\Information\Photos\Userform\"
MsgBox "tu as choisi " & .SelectedItems(1) & vbCrLf & _
"que tu peux copier où tu veux (utilisation simple de l'instruction FileCopy)"
'Renommer l'item sélectionné comme textbox14
Else
MsgBox " tu n'as choisi aucun fichier"
End If
End With |
Merci pour votre soutien.