Hi, I have used the following code to close my workbook. However, how do I adjust the code to catch an exception with a dialogue box, in the event the workbook is not open in the first place to close it? Thanks
Private Sub CloseDatabase_Button_Click()
Workbooks("Pricing Papers Received.xls").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close
'Workbooks("Pricing Papers Received.xls").Close
End Sub
Private Sub CloseDatabase_Button_Click()
Workbooks("Pricing Papers Received.xls").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close
'Workbooks("Pricing Papers Received.xls").Close
End Sub