The code snippet below is part of an Excel VBA Version 2507 (Build 19029.20208) procedure to create a PDF file from a worksheet range and create an email with the PDF as an attachment.
The procedure works under Windows 10 (old laptop).
The attachment is corrupt under Windows 11 2025-08 Cumulative Update for Windows 11 Version 24H2 for x64-based Systems (KB5063878) (26100.4946) (new laptop).
I found by accident a pause after creation of the pdf and before creation of the email allowed the procedure to complete correctly.
Hence the For_Next loop.
It would appear the background routine converting the pdf to an email attachment is the issue either because of the change of laptop or OS.
The new is faster than the old.
NOTE: The saved pdf is not corrupt only the attachment.
Sub part
'Create and save PDF
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, \_
printtofile:=True, prtofilename:=lcPDFname, IgnorePrintAreas:=False
'Generate strings to be pasted into the email
lcFundMsg = WorksheetFunction.Round((Range("Fund").Value), 2)
lcUnitCash = WorksheetFunction.Round(Range("UnitValue").Value, 2)
'and tidy both to £0.00 format
Call CashFix(lcFundMsg)
Call CashFix(lcUnitCash)
lcFundMsg = "No Club handicap reductions." & vbNewLine & "Paid to the fund this
session £" & lcFundMsg & " @ " & \_
lcUnitCash & "p/game." '& vbNewLine & "Michael."
'This pause allows code to work correctly
For lnI = 1 To 100000000# '00000000# '1E8 seems to be minimum delay
Next lnI
'Generate email
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
lcSignBy = "Michael"
With OutMail
.To = "Starters"
.CC = ""
.BCC = ""
.Subject = "Diddly Results Sheet for " & lvDate 'RsltHdr.Value
.Body = lcFundMsg & vbNewLine & lcSignBy
.Attachments.Add lcPDFname
.display
End With 'OutMail
End Sub
Unless my pause workaround is a digression and the fault lies in my coding I have to assume a problem with the conversion process of the attachment.

ExportAsFixedFormatinstead ofSelectedSheets.PrintOut, so you're not involving the print spooler. learn.microsoft.com/en-us/office/vba/api/…