... (1 Viewer)

jazsriel

Member
Local time
Today, 02:53
Joined
Dec 21, 2020
Messages
62
...
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 00:53
Joined
Oct 29, 2018
Messages
21,477
Use the Format() function. For example

Formate(Date()-1, "yyyymmdd")
 

Cronk

Registered User.
Local time
Today, 17:53
Joined
Jul 4, 2013
Messages
2,772
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?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:53
Joined
Oct 29, 2018
Messages
21,477
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

Top Bottom