G
Guest
I have the following code. I thought if I put Exit Sub after the error
message then the next line of code would not execute. For instance. If Dir
C:\My Documents\ does not exist then it will error. But when you click the
error message it shows the MsgBox "Exported to C:\My
Documents\BudgetExportCat.xls" which it should not show. How do I make it
bypass that message if there was an error.
Thanks,
Steven
Private Sub Command68_Click()
On Error GoTo Err_Command85_Click
Call ExportBudget
MsgBox "Exported to C:\My Documents\BExport.xls"
Exit_Command85_Click:
Exit Sub
Err_Command85_Click:
MsgBox Err.Description
Exit Sub
End Sub
message then the next line of code would not execute. For instance. If Dir
C:\My Documents\ does not exist then it will error. But when you click the
error message it shows the MsgBox "Exported to C:\My
Documents\BudgetExportCat.xls" which it should not show. How do I make it
bypass that message if there was an error.
Thanks,
Steven
Private Sub Command68_Click()
On Error GoTo Err_Command85_Click
Call ExportBudget
MsgBox "Exported to C:\My Documents\BExport.xls"
Exit_Command85_Click:
Exit Sub
Err_Command85_Click:
MsgBox Err.Description
Exit Sub
End Sub