I have this code:
ActiveWorkbook.Sheets(1).Select
ActiveSheet.Copy
ActiveSheet.Protect Password = "report"
ActiveWorkbook.SaveAs "S:\Production reports\" & Replace(Range("G3").Value, "/", "-") & "-" & Range("G5").Value, _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
The code automatically saves a report from the active workbook i am using in the correct location and file name i desire.
However, i am having some issues.
1) the password is not working. The resultant file IS password protected, but the password does not work to unlock it
2) the resultant file opens with an "Enable Content" message followed by "Trust files like these." I assume this is because the original file i am working with contains macros. I do not need macros in the resultant file, and i am worried these "warnings" will confuse people i have to email this report to.
Bookmarks