Printing Excel as PDF

  • Thread starter Thread starter Al S
  • Start date Start date
A

Al S

Hi All

Im stuck with this problem for the last couple of days. Its like this..
I have an excel workbook that contains 6 worksheets created
programmatically in C#. All Im trying to print this workbook in PDF
format in which case it should prompt me ONCE only to save it and then
should save it as one single pdf document with six pages. My problem is
it saves the 6 worksheets as 4 different pdf documents and prompts me 4
times. Any help would be greatly appreciated.

thx
Al

P.S the print code is

objBook.PrintOut(1, 6, 1, false, "Adobe PDF", false, Type.Missing,
Type.Missing);

The name of the Adobe distiller printer is "Adobe PDF"
 
I've had this problem from time to time. Often it because the dpi on
printer is not the same on each page. When I change it works ok.

Hope this helps
Hank
 
Al S said:
Hi All

Im stuck with this problem for the last couple of days. Its like this..
I have an excel workbook that contains 6 worksheets created
programmatically in C#. All Im trying to print this workbook in PDF
format in which case it should prompt me ONCE only to save it and then
should save it as one single pdf document with six pages. My problem is
it saves the 6 worksheets as 4 different pdf documents and prompts me 4
times. Any help would be greatly appreciated.

I found a fix to this problem, that works in Office 2000 anyway...

Each worksheet is created from a single worksheet.
Right click on the target worksheet, "Move or Copy", check "Make a Copy".

DON'T Insert->Worksheet.
DON'T populate more than a single worksheet that is to be printed from the
auto-generated ones.

Then format away. The result for me was a five page, single pdf, three
pages portrait, and two pages landscape (with graphics). Before applying
this trick, I had three individual pages (each as their own pdf) and a pair
of pages that had been copied one from the other (which was the clue)

Yes, it is a pain in the tush to copy the contents and the column widths
from existing spreadsheets, but it does pay off...

Assuming making the resolution the same for all pages doesn't work...
 
Back
Top