#1
|
|||
|
|||
vba Code to Print Spreadsheet to PDF
Hi
I am looking for a piece of vba code that I can use to automatically print an excel spreadsheet directly to a pdf file without user interaction. Can anyone help as I am struggling to create or find some. Thanks in advance. Tony |
#2
|
|||
|
|||
Hi Tony, maybe you can use this: ( you most have adobe acrobat installed, and the selected worksheets will be combined in a single PDF file!. If not, select only 1 sheet, and change your pdf printer adress):
Sub ImprimaPDF() Sheets(Array("pagina 1 plan", "plan afaceri")).Select Sheets("pagina 1 plan").Activate Application.ActivePrinter = "Adobe PDF din Ne02:" ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""Adobe PDF din Ne02:"",,TRUE,,FALSE)" Sheets("plan afaceri").Select End Sub |
#3
|
|||
|
|||
Or this, to print all selected sheets in 1 PDF file:
Sub ImprimaFoaieActivaPDF() ActiveWindow.SelectedSheets.PrintOut Application.ActivePrinter = "Adobe PDF din Ne02:" ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,""Adobe PDF din Ne02:"",,TRUE,,FALSE)" End Sub |
#4
|
|||
|
|||
Hi Catalin.B
Many many thanks, this is excellent. Tony |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to Print Individual Resource Lists to a pdf File | OTPM | Project | 0 | 05-24-2011 12:21 PM |
Creating a spreadsheet | nickypatterson | Excel | 1 | 01-14-2010 03:21 PM |
Looking for a specific spreadsheet | DivideByZer0 | Excel | 3 | 11-10-2009 05:58 PM |
Print preview and actual print do not match? | anthrax19888 | Word | 1 | 10-12-2009 08:09 AM |
Spreadsheet for words | Rosie | Office | 3 | 06-15-2005 02:27 PM |