Hello,
I am not sure if this is possible but what I want to do is to create a macro which will prompt the user to insert a password to make the workbook read only, then save it to a specified location using a cell within this worksheet as the file name, but in a compressed format.
I have a macro already which saves to a specified file name in a certain location but have no idea what to add to make it ask for a read only password and also to compress the file when saving.
I have copied below my current macro and I will be very grateful is anyone can suggest a solution.
Sub SaveFileAsDate()
Dim WSName As String, CName As String, Directory As String, savename As String
WSName = "XC Control Report Form"
CName = "F8"
Directory = "C:\Doc............\Test\"
savename = Sheets(WSName).Range(CName).Text
If Directory = "" Then Directory = CurDir & "\"
On Error GoTo errorsub:
ActiveWorkbook.SaveAs Filename:=Directory & savename & ".xls"
Exit Sub
errorsub:
Beep
MsgBox "Changes not saved!", vbExclamation, Title:=savename & ".xls"
End Sub
Thanks
Bookmarks