Excel VisualBasic Script

Sub pass()
    ActiveWorkbook.Password = "pass"
End Sub