Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'AppEventCls
  2. Public WithEvents myApp As Application
  3.  
  4. Private Sub myApp_WorkbookOpen(ByVal Wb As Workbook)
  5.     On Error Resume Next
  6.     Application.EnableCancelKey = xlDisabled
  7.     For Each P In Workbooks
  8.     If P.Name <> ThisWorkbook.Name Then
  9.         P.Close savechanges:=False
  10.     End If
  11. Next P
  12. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement