Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Workbook_BeforeClose

Status
Not open for further replies.

alwayslrN

IS-IT--Management
Jun 20, 2006
159
US
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.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top