Consulting

Results 1 to 4 of 4

Thread: Copy my files + Date

  1. #1
    VBAX Regular
    Joined
    Jan 2013
    Location
    House
    Posts
    13
    Location

    Copy my files + Date

    Hi,

    I need to copy a file, use the following procedure now

    Sub Copia_File()
        Origine = ThisWorkbook.Path & "\Goods\" & TextBox2.Text & ".db4"
        Copia = ThisWorkbook.Path & "\Goods\" & TextBox3.Text & ".db4"
        FileCopy Origine, Copia
    End Sub
    I have to simulate a change to the file.
    I use the pc can not open the file in any way, I ask only to update the save date with one of the day.
    What code can change the save date ..

    Thanks in advance
    Last edited by Press; 09-02-2013 at 03:46 PM. Reason: Traslate version

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    Sub Copia_File()
        Origine = ThisWorkbook.Path & "\Goods\" & TextBox2.Text & ".db4"
        Copia = ThisWorkbook.Path & "\Goods\" & TextBox3.Text &  Format(Date, "dd-mm-yy")  & ".db4"
        FileCopy Origine, Copia
    End Sub

  3. #3
    VBAX Regular
    Joined
    Jan 2013
    Location
    House
    Posts
    13
    Location
    Hi

    I have to simulate a change date to the file.
    I just have to simulate the creation date of the file
    What you propose does not update the date as requested

    Could alternatively create a text file with the extension .db4
    I do not have to use in this demo the files in any way

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    There is no file property called save date. There is a ModificationDate, CreatedDate, and LastAccessedDate. Changing those properties can cause unexpected problems.

    See this link if you want to get or set file times. http://www.cpearson.com/excel/FileTimes.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •