Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Here's a Simple Code To Convert or Print Multiple Excel Sheets into a SINGLE PDF File

2 views
Skip to first unread message

Digitaldoc

unread,
Apr 16, 2007, 6:17:44 PM4/16/07
to
Using Bits, Pieces and tips from all across the forum, this is the
simple code that finally did it for me :

'SET DEFAULT PRINTER TO ADOBE FOR PDF REPORTS
Set Application.Printer = Application.Printers("Adobe PDF")


'PRINT to PDF - (To Include Additional Excel Sheets on the PDF, Simply
add the Name of the Excel Sheet in Both the Arrays Below)


Dim ObjXL As Object
Set ObjXL = CreateObject("Excel.Application")

ObjXL.workbooks.Open ("....path name of the Excel file goes here....")

'SELECT REQUIRED EXCEL SHEETS FOR PRINTING TO PDF

ObjXL.ActiveWorkbook.Sheets(Array("Income Statement", "Balance Sheet",
"Additional Data", "Existing Debt", "New Debt", "Projection", "Cash
Flow", "Key Ratios", "Chapter Ratios", "Standard Ratios", "Triage
Test", "Comments")).Select

'PRINT THEM SUCKERS to A SINGLE PDF;-)

ObjXL.ActiveWorkbook.Sheets(Array("Income Statement", "Balance Sheet",
"Additional Data", "Existing Debt", "New Debt", "Projection", "Cash
Flow", "Key Ratios", "Chapter Ratios", "Standard Ratios", "Triage
Test", "Comments")).PrintOut , collate:=True

Works Great on my Windows XP !


If the Set Application.Printer code generates an error for you , then
you can easily set the default printer to Adode manually - Click Start
--> Printers and Faxes --> Right Click on Adobe -->Set as Default

Hope this will help at least some people :-)

Digitaldoc, MD
http://MDsalaries.blogspot.com
http://www.USMLEtoMD.com

Digitaldoc

unread,
Apr 18, 2007, 4:08:35 AM4/18/07
to
A Simple VBA Code, that is
0 new messages