sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,422
- Office Version
- 2016
- Platform
- Windows
I have a routine which prompts the user to choose a folder to save an embedded Word document as PDF;
It works fine, except if the user clicks cancel in which case it doesn't save the file but carries on with the rest of the procedure, which is not what I want so I need to incorporate a method to do the following if they click cancel;
1) Prompt asking if they want to cancel - if yes then exit sub
2) If they choose to try again then show the GetSaveAsFilename dialog again (then repeat the process)
What I'm trying to do essentially is come up with a way that they either keep going back to choose a folder to save or exit the routine.
Hope I've made sense!
Code:
FilePath = Application.GetSaveAsFilename(InitialFileName:=File121, FileFilter:="PDF Files (*.pdf), *.pdf", Title:="Select Folder to save")
It works fine, except if the user clicks cancel in which case it doesn't save the file but carries on with the rest of the procedure, which is not what I want so I need to incorporate a method to do the following if they click cancel;
1) Prompt asking if they want to cancel - if yes then exit sub
2) If they choose to try again then show the GetSaveAsFilename dialog again (then repeat the process)
What I'm trying to do essentially is come up with a way that they either keep going back to choose a folder to save or exit the routine.
Hope I've made sense!