Avoid clumsy coding:
Don't bother with 'protection' in Excel.
To retrieve yesterday's outmails to external addresses:
Sub M_uit()
For Each it In Createobject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items.Restrict("[Senton]>'" & Date - 1 & "' and [Senton]<'" & Date & "'")
If Right(it.Recipients(1).Address, 10) <> "@mycompany" Then y = y + 1
Next
sheet1.cells(Rows.Count, 1).End(xlup).offset(1).resize(, 2) = Array(Date - 1, y)
End Sub
Have a look also here: http://www.snb-vba.eu/VBA_Outlook_external_en.html#L_5