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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,754
Messages
6,126,680
Members
449,328
Latest member
easperhe29

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