excel vba - save file as read only

  • Thread starter Thread starter chief
  • Start date Start date
C

chief

Here is the rundown of what happens in this project

1. The user opens the page
2. Fills out the required info
3. clicks on the command button 1 to save and print, this saves th
file as the invoice # in a specific location
4. when they open the page again, it returns a sequential invoice #
5. they then must click on another button in order to make the save
client info disappear
6. once they do this, certain cells which are not for data entry wil
become protected
7. the process recycles at step 2

In Userform1 I have

Private Sub CommandButton1_Click()
ActiveWorkbook.Save
Sheet1.SaveAs FileName:="Q:\SALES POs\" & Range("K5").Value
Range("A1:M56").PrintOut
ActiveWorkbook.Close

End Sub

In This Workbook I have

Private Sub Workbook_Open()

Sheet1.Unprotect
Range("F7").Select
Range("K3") = Now()
Range("K3").NumberFormat = "mmmm d, yyyy"
With Me.Sheets("Sheet1").Range("K5")
.Value = .Value + 1
.NumberFormat = "0000"
End With
UserForm2.Show

End Sub

In SHEET 1 I have

Private Sub CommandButton1_Click()

Range("C9:D15,E15:F15,I9:L15,B19:B38,C19:C38,D19:D38,K39:L40,K44:L44,D43:E43,C47:F49,K54:L54").ClearContents

Range("C9:D15,E15:F15,I9:L15,B19:B38,C19:C38,K39:L40,K44:L44,D43:E43,C47:F49,K54:L54").Select
Selection.Locked = False
Sheet1.Protect
Range("E8").Select
End Sub

What would be the code in order for this series of events to happen:

1. Person clicks on userform 1 in order to save the file to the "Q
location
2. The newly saved file becomes read only
3. The file is copied and pasted into "H:\RETAIL SALES POs\"

Beyond that, is there some type of way to make it so that the save
file in "Q" or "H" cannot be copied by someone manually and then paste
to another location where that person can change the information insid
that saved sheet?

I think it sounds confusing but I don't think it has to be

Any ideas
 
Back
Top