Hi all.
I have code that checks before a sheet is saved
What would I use if I wanted it check the same thing except it will be exporting to PDF and not saved.Please Login or Register to view this content.
Thx.
Hi all.
I have code that checks before a sheet is saved
What would I use if I wanted it check the same thing except it will be exporting to PDF and not saved.Please Login or Register to view this content.
Thx.
Do you have a PDF converter installed on your PC? If not, that is your first step. I copied this from a thread I read a while back, so I cannot remember the exact source, but it should get you started:
---------------------------------------------------------
I've searched the message board and found several questions, but not a good example of how to print automatically from Excel to a PDF file. After a couple of days of searching and tweaking, I've got what I think is a fairly good solution for automating your printing of worksheets to PDF files.
This solution requires the use of PDF995. This is a free utility available at www.PDF995.com. This is a print driver that allows you to print to a PDF file. The file is compatible with Adobe and can be read with the Adobe reader like any other PDF. The free version does pop-up some advertising with each print, but the automation works with around the pop-ups. I believe the full license version is about $10 and doesn't produce the pop-ups.
The challenge in automating a PDF process is that the PDF driver will prompt the user for a filename. This is ok if you are printing just one sheet, but if you need to automate the production of several PDFs, you need to be able to specify the name of the file in the code. The subroutine SheetToPDF presented below allows you to specify a single worksheet and the full filename for the PDF. I've included all the code and external declarations needed. The two subs at the bottom give examples of how to call SheetToPDF with the passed parameters.
I hope you find this helpful.
Regards,
Steve
Please Login or Register to view this content.
Steve,
Code from this site
http://www.excelguru.ca/node/21
VBA Noob
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks