Public Sub SheetUnlocker()
Application.DisplayAlerts = False
'=================
'Unlocks the Sheet
'=================
ActiveSheet.Unprotect ("BlueberryPies")
'================================
'Creates the email for the unlock
'================================
'From Ron Bruin
'Working in 2000-2007
'This example send the last saved version of the Activeworkbook
Dim OutApp As Object
Dim OutMail As Object
Dim PDFUpdate As String
Dim strbody As String
Dim SigString As String
Dim Signature As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "Unlock Event - " & ActiveSheet.Name
.HTMLBody = "Please right a brief description of why the unlock was needed"
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display 'or use .Send or Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
'=======================
'Ends creating the email
'=======================
Application.DisplayAlerts = True
End Sub
|