The input box for the password comes up, then the dialog box for Save As comes up but after I type a file name and click save, I get an error: "Run-time error 1004': Method 'SaveAs' of object '_Workbook' failed. Many thanks in advance!
Code
Sub SaveAs()
Dim WritePW As String
WritePW = InputBox("Enter password for Write Permissions", "Password Input")
Dim workbook_name As String
workbook_name = Application.GetSaveAsFilename(InitialFileName)
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename = workbook_name, FileFormat = 52, WriteResPassword = WritePW, ReadOnlyRecommended = True
End Sub
Display More