Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Procedure is executed when the workbook is closed

Private Sub Workbook_BeforeClose(Cancel As Boolean)     Open Application.Path & "\test.txt" _       For Append As #1     Print #1, "Stopped " & Now     Close #1 End Sub