Quote Originally Posted by wdg1 View Post
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")
datedoc = Range("B5")
Path = "C:\Users\gebruiker\factuur"
' fname = Toganr & slo & volgnr & datedoc
fname = Toganr & " - " & slo & " - " & volgnr & " - " & datedoc


MsgBox Path & fname  '  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, ignoreprintareas:=False, Filename:=Path & fname
______
Here I did put the value of cell B5 into "datedoc".
The macro does not work.

Not being a mind reader or having a workbook to test, I'm guessing that if you added the marked line, there's no backslash before fname

Otherwise it depends on the contents of the ranges that are used to construct the fname