Print charts under VBA control from Excel 2007

P

Patricia Shanahan

I have some Excel 2007 spreadsheets that contain a lot of charts,
constructed using VBA. I would like to also automate printing them, one
chart per file, either .pdf or postscript.

Any advice on the best way to do this?

[I am an experienced programmer, but a VBA novice]

Thanks,

Patricia
 
J

Jeff Norville

I was struggling to get appx 60 charts printed to one Excel file using
the Acrobat writer; found this, worked well (though required
installation of an additional DLL, PDFCreator):
http://www.excelguru.ca/node/21#MultiSingle

There's a useful link to some of the gotchas around printing to PDF
from Excel which you've no doubt discovered.
 
P

Patricia Shanahan

Thanks. Sample code is very useful, especially when programming in an
unfamiliar language.

I have an alternative of printing to a postscript file, using an already
installed postscript driver, and running the output through a pstopdf
utility. I can automate the pstopdf step with a makefile. Do you think
installing PDFCreator is a better approach?

Thanks again,

Patricia


Jeff said:
I was struggling to get appx 60 charts printed to one Excel file using
the Acrobat writer; found this, worked well (though required
installation of an additional DLL, PDFCreator):
http://www.excelguru.ca/node/21#MultiSingle

There's a useful link to some of the gotchas around printing to PDF
from Excel which you've no doubt discovered.


I have some Excel 2007 spreadsheets that contain a lot of charts,
constructed using VBA. I would like to also automate printing them, one
chart per file, either .pdf or postscript.

Any advice on the best way to do this?

[I am an experienced programmer, but a VBA novice]

Thanks,

Patricia
 
P

Patricia Shanahan

Patricia said:
I have some Excel 2007 spreadsheets that contain a lot of charts,
constructed using VBA. I would like to also automate printing them, one
chart per file, either .pdf or postscript.

Any advice on the best way to do this?

I have since found the Chart.ExportAsFixedFormat method. One of the
XlFixedFormatType values is xlTypePDF, which produces a .pdf file
directly, without going through a printer. The result is in PDF version 1.5.

I need the charts for inclusion in a LaTeX document. I got a pdflatex
warning about the PDF version until I added

\pdfminorversion=5

near the start of my TeX file, before the first \includegraphics.

Patricia
 
S

Stuart

Jeff,
Thanks, I have had the same problem and the download of PDF Creator has
fixed the problems.
Cheers,

Stuart

Patricia Shanahan said:
Thanks. Sample code is very useful, especially when programming in an
unfamiliar language.

I have an alternative of printing to a postscript file, using an already
installed postscript driver, and running the output through a pstopdf
utility. I can automate the pstopdf step with a makefile. Do you think
installing PDFCreator is a better approach?

Thanks again,

Patricia


Jeff said:
I was struggling to get appx 60 charts printed to one Excel file using
the Acrobat writer; found this, worked well (though required
installation of an additional DLL, PDFCreator):
http://www.excelguru.ca/node/21#MultiSingle

There's a useful link to some of the gotchas around printing to PDF
from Excel which you've no doubt discovered.


I have some Excel 2007 spreadsheets that contain a lot of charts,
constructed using VBA. I would like to also automate printing them, one
chart per file, either .pdf or postscript.

Any advice on the best way to do this?

[I am an experienced programmer, but a VBA novice]

Thanks,

Patricia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top