Link to home
Start Free TrialLog in
Avatar of Thom McCarthy
Thom McCarthyFlag for United States of America

asked on

Using pdf995 in macro gets error

I have a macro that selects and prints a chart.
When I do a "Record Macro" and tell it to print using PDF995, I get a good PDF file.
When I use :
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, PrToFileName:="c:\Zaas\dir1.pdf", the pdf file is three times bigger and won't open.
The error message says either the file's an incompatable format or it's corrupted.

I'd appreciate any help.
Thanks

Sub Dir1()
'
' Dir1 Macro
' Macro recorded 10/23/2008 by tmccar10
'
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.ChartArea.Select
    Application.ActivePrinter = "PDF995 on Ne00:"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, PrToFileName:="c:\Zaas\dir1.pdf"
    
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of TadSter
TadSter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Thom McCarthy

ASKER

Thanks Tad-

Unfortunately, I need this to distribute this to a lot of people and my company doesn't provide Acrobat to many people.

I can use pdf995 with the same intervention  you mentioned. I was trying to avoid that, as you can imagine.

I appreciate the code and I'll keep it, just in case.