View Single Post
  #3  
Old 21-11-2016, 14:33
FaneDuru FaneDuru is offline
Member
 
Join Date: May 2012
Posts: 35
Default

Thanks!
I found a similar workaround:
Code:
Inceput:
'Code using GetFileBox to select the name but seeing the pictures there, returning strFile...

Director = Left(strFile, InStrRev(strFile, "\"))
NumeDublu = Right(strFile, Len(strFile) - InStrRev(strFile, "\"))
  
  Fisier = Dir$(Director)
  Do While Len(Fisier) <> 0
    Fisier = Dir$: If Fisier = NumeDublu Then GoTo Nasol
  Loop
  Filter.Finish 

  'Some other code here...

   GoTo Sfarsit
Nasol:
  Dim Rasp As VbMsgBoxResult
   Rasp = MsgBox("The file named """ & NumeDublu & """ already exists in the export location." & vbCrLf & _
                 "  Would you like to rewrite it?" & vbCrLf & vbCrLf & _
                 "  If yes, please choose ""Yes""..." & vbCrLf & _
                 "  For renaming choose ""Cancel"".", vbYesNoCancel, "Existing name")
        If Rasp = vbYes Then
            Filter.Finish

            'some code here...

            GoTo Sfarsit
        End If
        If Rasp = vbCancel Then GoTo Inceput
Sfarsit:
Reply With Quote