How do I use "date document" for a PDF file name?
The declaration of "document date" causes an error:
Dim datedoc As Date
Then I use datedoc to my PDF-file name which does not work.
___________Sub InvoiceToPdf() Dim volgnr As Long Dim slo As String Dim Toganr As Long Dim bedrag As Currency Dim fname As String Dim datedoc As Date volgnr = Range("B1") slo = Range("B2") Toganr = Range("B3") bedrag = Range("B4") Path = "C:\Users\gebruiker\factuur" ' this works not, the datedoc causes error fname = Toganr & " - " & slo & " - " & volgnr & " - " & datedoc ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, ignoreprintareas:=False, Filename:=Path & fname End Sub
Thanks, Ward