...

jazsriel

Member
Local time
Today, 17:23
Joined
Dec 21, 2020
Messages
65
...
 
Last edited:
Use the Format() function. For example

Formate(Date()-1, "yyyymmdd")
 
You are trying to change a file name to 03/26/2022.....pdf

It's an invalid file name if forward slashes are included. Use a dash?
 
I was trying to do that, but with the code I was using it would not allow it, kept erroring out. I could give you more details once I am back at work in a few days, but from what I can remember the part that was erroring out was during the actual rename...
(keep in mind I am trying to do this from memory so might not be entirely accrate on the command)

fso.namefile "pathtofilelocationIwanttocopy\from.pdf", "pathtofilelocationIwanttoputthenewfileinto\" & Format(Date()-1, "mm/dd/yyyy") & "Contractor Packet.pdf"

Anyway in a few days I can give better information if this is not enough to get us moving in the solution direction again.
Please notice in the sample code I suggested, I didn't use any slashes. Also, I put the year first to assist in sorting the filename, in case it's needed.
 

Users who are viewing this thread

Back
Top Bottom