jardenp
Active Member
- Joined
- May 12, 2009
- Messages
- 373
- Office Version
- 2019
- 2016
- 2013
- 2011
- 2010
- Platform
- Windows
I'm puzzled by the problem I'm having:
I want to save the current sheet as a PDF with the filename "Receipt YYYY-MM-DD HH:MM.pdf" (That is YEAR-MONTH-DAY HOUR:MINUTE)
I have this working:
but when I try to add the minutes, this doesn't work:
Ive experimented with things along the line of
but I always get errors.
Is there a simple way to do this that I'm missing?
Thanks,
JP
I want to save the current sheet as a PDF with the filename "Receipt YYYY-MM-DD HH:MM.pdf" (That is YEAR-MONTH-DAY HOUR:MINUTE)
I have this working:
Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"S:\ ...\Receipt " & Format(Now, "yyyy") & "-" & Format(Now, "mm") & "-" & Format(Now, "dd") & " " & Format(Now, "HH") & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
but when I try to add the minutes, this doesn't work:
Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"S:\ ...\Receipt " & Format(Now, "yyyy") & "-" & Format(Now, "mm") & "-" & Format(Now, "dd") & " " & Format(Now, "HH") & ":" & Format(Now, "nn") & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Code:
Format(Now, "yyyy-dd-mm hh:nn")
Is there a simple way to do this that I'm missing?
Thanks,
JP