I have a user interface where the user enters some information. Then they press a button for a report to be generated. The user however cannot have left certain files open while the report is generated. If the user leaves a file open, I want an error message to pop up to inform them of this. And then I want a way for the user to fix the problem (close the file) without having to restart the program as they already entered information.
I have the MsgBox pop up:
Do While IsFileOpen(wfileName)
MsgBox "Please close the Weights Machine Data Excel File '" & getFileName(wfileName) & "' to proceed", vbInformation, "Error"
Loop
The problem is that the user cannot do any thing once the error message happens. I know that MsgBox
is modal, but is there a way to get around that. If not I want the user to return to the point before they pressed the generateReport
Button, so they do not have to retype any of the information they inputted. How do I go about solving this?