Example 1: Protect your Sheet with All Default options Function ProtectSheet_Default() 'To protect the Sheet1 without any password with all default parameters Worksheets("Sheet1").Protect End Function Example 2: Protect your Sheet with a password Function ProtectSheet_Password() 'To protect the ...
Sub MyMacro()Sheet1.Unprotect Password:="Secret" 'YOUR CODE Sheet1.Protect Password:="Secret"End Sub As you can see, the code un-protects Sheet1 with the password "Secret", runs the code and then password protects it again. This will work but has a number of drawbacks with one being ...
Could your macro be changed to have the function be: File-Info-Protect Workbook-Encrypt with Password? egillhelgaso this appears to be the same as the Save As option except with the Save As option you can select a PW for open (encryption) and a different PW for edit. ...
I tried to make a macro, by recording a macro, that was supposed to Protect a workbook with an encrypted password when a certain condition was met. The problem is, that it seems not to be able to re... mtarlerThank you. This runs neatly. But what I needed is not protection ...
I saw a few posts with me.protect UserInterfaceOnly:=True, but I wasn't able to get that working. Edit: I tried adding this as well, and it's not working either. Sheet1.Protect Password:="password", UserInterFaceOnly:=True excel vba password-protection Share Improve this question Follow ...
delete sheetprotectmacrovba Replies: 2 Forum:Excel Questions A Secure / Protect Your Macro Hello, I search the forum but can't find a thread which informs how we can secure our macros. Maybe it is so easy but I am a newbie :) Is there an option in excel developer section or a code...
Hi! Please paste this code in "ThisWorkBook Module". But this code protect all sheets in the workbook. :This macro needs to run if all sheets have protection. How should I judge this?Does something sign exist in each sheet? Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel...
2.1.858 Part 3 Section 19.694, table:password 2.1.859 Part 3 Section 19.697, table:print 2.1.860 Part 3 Section 19.698, table:print-ranges 2.1.861 Part 3 Section 19.699, table:protect 2.1.862 Part 3 Section 19.700, table:protected 2.1.863 Part 3 Section 19.700.4, table:table 2.1...
Protect Documents(“Example.doc”).Protect Password:=”password” Unprotect Documents(“Example.doc”).UnProtect Password:=”password” Number of Pages Dim varNumberPages as Variant varNumberPages = _ ActiveDocument.Content.Information(wdActiveEndAdjustedPageNumber) Print Documents(“Example.doc”).Prin...
Protect Documents(“Example.doc”).Protect Password:=”password” Unprotect Documents(“Example.doc”).UnProtect Password:=”password” Number of Pages Dim varNumberPages as Variant varNumberPages = _ ActiveDocument.Content.Information(wdActiveEndAdjustedPageNumber) Print Documents(“Example.doc”).Prin...