vbexceltuto
New Member
- Joined
- Aug 27, 2019
- Messages
- 5
In Excel 2007 I Create file and macro (vba), I protected workbook using password
and to avoid Security warning when closing file through icon red (X) and reopen file and after save my data and indeed, the problem is solved
Steps
1- to avoid Security warning (code problem solved is down )2- Closing file with red icon (X)
3- Reopen file
4- Save my work
5- work fine
But window Security warning arise when Closing file with Task manager and next reopen file, code above not working
and to avoid Security warning when closing file through icon red (X) and reopen file and after save my data and indeed, the problem is solved
Steps
1- to avoid Security warning (code problem solved is down )2- Closing file with red icon (X)
3- Reopen file
4- Save my work
5- work fine
PHP:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Unprotect Password:="blabla" ThisWorkbook.Save ThisWorkbook.Saved = True
End Sub
Private Sub Workbook_Open()
ThisWorkbook.Protect Password:="blabla" ThisWorkbook.Save ThisWorkbook.Saved = True
End Sub
But window Security warning arise when Closing file with Task manager and next reopen file, code above not working