PDF Corruption Issue

kingewing

New Member
Joined
Aug 15, 2015
Messages
3
I have been using this macro for about 6 years to print from Excel to PDF:

Sub SelectPrintSheets()
Dim shtName As String, prShts As String, ws As Worksheet, shArr

shtName = Sheets("Setup").Range("C3").Text & "_" & Sheets("Setup").Range("C5").Text

For Each ws In Worksheets
Select Case ws.Name
Case "Setup", "Master", "Stmt"

Case Else
prShts = prShts & ws.Name & ","
End Select
Next ws

If prShts = "" Then Exit Sub
shArr = Split(Left(prShts, Len(prShts) - 1), ",")
Sheets(shArr).Select

Application.DisplayAlerts = False 'allows PDF to overwrite priors
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ActiveWorkbook.Path & "\" & shtName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True

Worksheets("Setup").Activate
End Sub

Out of nowhere, all of a sudden the pdf's being produced are corrupted in some way. They open in Adobe, so everything appears ok, but if I attempt to use any tools (such as extract pages), I receive object not found errors. Any suggestions? Thank you all for your help.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
That's very odd. Have you tried it on PDF files that you know previously worked, to see if they still do?
Also, if might be worth asking on the Adobe forum if you don't find any solutions here (if you haven't already).
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,953
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top