Bonjour, voici ma fonction mais lorsque je clique dans la boite de dialogue windows annuler ou croix ;je souhaiterai quittez la tache.Hors ca ne marche pas ca continu.
J'aimerai faire un truc du genre :
If objFolder.Title = false Then exit sub
mais impossible dans une fonction.
1 2 3 4 5 6 7 8
| Public Function BrowseAndCreate(Title As String, Optional Config As vbConfigBrowse = 0) As String
Dim Shell As Variant, Folder As Variant
Set Shell = CreateObject("Shell.Application")
On Error Resume Next
If objFolder.Title = "" Then chemin = ""
Set Folder = Shell.BrowseForFolder(hWnd, Title, Config, "")
BrowseAndCreate = Folder.Items.Item.Path
End Function |
Partager