glasscda
asked on
Printing Multiple Charts as One Print Job in Excel 2003 VBA
I can print multiple charts but need to submit them as one print job from Excel VBA, especially if printing to a PDF file. The following works fine except it makes multiple print jobs / PDF files. Collate doesn't seem to work. Any help appreciated. Code snippet included.
For i = 1 To ActiveSheet.ChartObjects.Count
ActiveSheet.ChartObjects(i).Activate
ActiveChart.ChartArea.Select
With Selection
.PageSetup.CenterHeader = ""
.PageSetup.CenterFooter = "&p"
.PageSetup.LeftFooter = "Data Source "
End With
If i = ActiveSheet.ChartObjects.Count Then
ActiveChart.PrintOut copies:=1
Else
ActiveChart.PrintOut copies:=1, Collate:=True
End If
Next i
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
my comment on 4/28/08 worked as the solution.
ASKER
I have found what I think is actually a much better solution that accomplishes 2 things:
1) send the files to Powerpoint - this works amazingly fast!
2) then print from Powerpoint IF desired
The REALLY nice thing about this solution is that in many cases users don't want to print out anyway but really what to send the charts electronically. Instead of printing to PDF as we've done in the past we can create Powerpoint slides which can also be fit right into presentations. This works REALLY slick(ly).
This is a simplification of a solution I found on the internet (I kept the original credit in the code). Note that the Powerpoint Object Library must be checked under Visual Basic Tools -> References and there must be an open powerpoint presentation for this to work. I added a little error catch in case a powerpoint presentation is not open. Good also to warn users that whatever is their current open powerpoint will be appended.
Open in new window