To set a "password to modify," set the WritePassword property of the Workbook object.
Sub passWrite() ActiveWorkbook.WritePassword = "pass" End Sub