View Single Post
 
Old 06-08-2022, 11:53 PM
Rzv Rzv is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2022
Posts: 3
Rzv is on a distinguished road
Default

The code works perfectly until it hits runtime error 5138
Hitting debug then points me to
Code:
.PageSetup.DifferentFirstPageHeaderFooter = True
Still, this is much better than doing things manually and if there is no fix I will just find a way to discover which document is the problem and just do it manually.
Thank you.
Edit:
I found the problem there are some weird documents with impossible margins, and I found a way to mass rename and remove the special chars from the filenames, the code is working as intended, thank you for your help!
Attached Images
File Type: png VBA Err 5138.png (6.3 KB, 16 views)
Reply With Quote