Changing the File Date Created and Date Modified

ghettosega

New Member
Joined
Apr 27, 2004
Messages
49
Hi there

Is there a way I could change the File Date Created/Modified so that when I look at the properties of the file it would be changed???
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi,

Try this :

Code:
 Sub Test()

    With ThisWorkbook
    
        '\\ Display Real creation date
        MsgBox "Creation Date  :  " & _
        Format(.BuiltinDocumentProperties("Creation Date"), "Long Date")
        
        '\\ Set Fake creation Date :- Minus 1 Year !
        .BuiltinDocumentProperties("Creation Date") _
        = Format(DateAdd("yyyy", -1, Date), "Long date")
        
        '\\ Display Fake creation Date
        MsgBox "Fake Creation Date  :  " & _
        Format(.BuiltinDocumentProperties("Creation Date"), "Long Date")
        
        '\\ Save Workbook
        .Save
        
        '\\ Display Real Last Save Time
        MsgBox "Last Saved at :  " & .BuiltinDocumentProperties("Last save time")
        
        '\\ Set Fake Last Save Time :- Minus 10  Hours !
        .BuiltinDocumentProperties("Last save time") = Date & "  " & Time + TimeSerial(-10, 0, 0)
        
        '\\ Display Fake Last Save Time
        MsgBox " Fake Last Save Time changed to :  " & .BuiltinDocumentProperties("Last save time")
    
    End With

End Sub

The two Properties are actually Read & Write so as the code shows, you can easily set them via code.

Regards.
 
Upvote 0

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,093
Latest member
ripvw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top