Zo doet íe het wel...
Sub PRINT_TO_PDF()
Dim sName$
Dim Path$
sName = ActiveSheet.Name
Path = CreateObject("WScript.Shell").specialfolders("Desktop")
yearday = Format(DateDiff("d", CDate("1/1/" & Year(ActiveSheet.Range("B2"))), CDate(Range("B2"))) + 1, "000")
On Error Resume Next
ThisWorkbook.ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Path & "\" & Year(Range("c5")) & "-" & "week" & "-" & DatePart("ww", Date - Weekday(Date, 2) + 4, 2, 2) & " " & sName & " .pdf", _
openafterpublish:=True
' Filename:=Path & "\" & Year(Range("c5")) & "-" & "week" & "-" & Format(Range("C5"), "ww", vbMonday) & " " & sName & " .pdf", _
openafterpublish:=True
If Err.Number > 0 Then MsgBox "Error saving pdf."
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.2)
.FooterMargin = Application.InchesToPoints(0.1)
.PaperSize = xlPaperA4
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub
(dank aan Guru snb: DatePart("ww", Date - Weekday(Date, 2) + 4, 2, 2))