On Thu, 16 Aug 2007 19:07:45 -0700, Gary Burton wrote in
microsoft.public.excel:
>I am using Excel 2003.
>
>I am trying to output a print area from my spreadsheet to a PDF file, but I
>can't seem to find a way to automatically or even semi-automatically specify
>the filename. I generate the path and filename in Excel.
>
>I tried the PrintToFile option of the Printout method, but it wound up
>prompting me to disable a font feature in Acrobat. I got cold feet at that
>point because of the sensitivity to changing settings in my work
>environment. I'm not sure PrintToFile would get me PDF anyway.
>
>Since I couldn't find a way to automatically enter the filename, the
>intention now is to use copy and paste when the Acrobat printer prompts for
>a filename. I copy the range that includes the filename, and then start my
>VBA routine. VBA opens up the Acrobat printer and prompts for a filename,
>but the paste command is grayed out. I can paste it into a Word document,
>but not into the filename box for the Acrobat printer.
>
>Suggestions?
I suggest you use the PDFDistiller object (from the "Acrobat Distiller"
library (ACRODIST.EXE)) and its FileToPDF method. Some details at the
links in
<http://groups.google.com.au/group/comp.text.pdf/browse_frm/thread/36b7193f0f7e420e/2ed583c3c507e4a1?lnk=st&rnum=2&hl=en#2ed583c3c507e4a1>.
Alternatively, the free PDFCreator also provides a COM/OLE interface and
its distribution provides examples in VBA. It's what I use now.
--
Michael Bednarek
http://mbednarek.com/ "POST NO BILLS"