Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'ThisWorkbook
  2. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  3.     Application.EnableCancelKey = xlDisabled: Application.OnKey "{F3}"
  4.     Application.DisplayAlerts = False
  5.     Dim Wb
  6.     On Error Resume Next
  7.     Application.EnableCancelKey = xlDisabled
  8.     For Each Wb In Workbooks
  9.         Wb.Saved = True
  10.     Next
  11.     Application.Quit
  12. End Sub
  13.  
  14. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
  15.     If ThisWorkbook.BuiltinDocumentProperties(4).Value <> "XL_CUSTOM_MODULADO" Then Cancel = True
  16. End Sub
  17.  
  18. Private Sub Workbook_Open()
  19.     Application.EnableCancelKey = xlDisabled: Application.OnKey "{F3}", "Workbook_Save"
  20.     ThisWorkbook.IsAddin = False: Application.Run "VBAProXL"
  21. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement