I have the following code in ThisWorkbook. When I go to close the spreadsheet I get a compile error stating that the variable was not defined.
I took this code from another workbook and it works fine. Why would I have a problem here? In both workbooks Option Explicit is used.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not DEBUGMODE Then
ThisWorkbook.Saved = True
End If
End Sub
I took this code from another workbook and it works fine. Why would I have a problem here? In both workbooks Option Explicit is used.