-
Save a copy of an excel file as Read Only
Hey guys,
I was wondering if anyone would be able to help me out. I need a code that will save a copy of an Excel file as a part number that is in the B1 field. With a date stamp and make the copy read only. I was wondering if anyone had any idea's. Basically I want to be able to look back at the data and I will need to know the part number which changes. But the part number is located in the file B1. Than I want to know the date and time it was saved. I also want to view the data at a later date without the option for operators to change the information. An example of the format would be Part_yyyy_mm_dd hh. If anyone could help i would really appreciate it.
-
Also I have a folder named data on my desktop that will hold all the saved read only files.
-
This is what I have so far. It saves a copy with the part number and date stamp but I am still trying to get it set as a read only.
Sub SaveTest()
Dim Path As String
Dim FileName1 As String
Dim DateTime As String
Path = "C:\Users\cory.christner\Desktop\Data\"
FileName1 = Range("B1")
DateTime = " (" & Format(Now, "yyyy-mm-dd hhmm") & ").xlsm"
ActiveWorkbook.SaveCopyAs Filename:=Path & FileName1 & "-" & DateTime & ".xlsm"
End Sub
-
Why don't you save historical date in the workbook itself ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules