ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing an entire workbook from VB (https://www.excelbanter.com/excel-programming/276085-printing-entire-workbook-vbulletin.html)

Arawn

Printing an entire workbook from VB
 
I need to be able to open a workbook, and print the entire contents in
batches of 250 pages. My current method works GREAT on worksheets,
but it misses charts/graphs completely (this is bad, LOL). My code
for printing is:

If PageCount <= 250 Then
ActiveWorkbook.Worksheets.PrintOut From:=1, To:=250,
Copies:=1, Collate:=True
End If

If PageCount = 250 Then
ActiveWorkbook.Worksheets.PrintOut From:=1, To:=250,
Copies:=1, Collate:=True
ActiveWorkbook.Worksheets.PrintOut From:=251, To:=500,
Copies:=1, Collate:=True
End If

and so on...

I know that my error has to be with not grasping the difference
between a Chart and a Worksheet, but I'm stuck.

Any help would be appreciated!

~Arawn

Ron de Bruin

Printing an entire workbook from VB
 
Hi Arawn

Change Worksheets in your code to Sheets

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Arawn" wrote in message om...
I need to be able to open a workbook, and print the entire contents in
batches of 250 pages. My current method works GREAT on worksheets,
but it misses charts/graphs completely (this is bad, LOL). My code
for printing is:

If PageCount <= 250 Then
ActiveWorkbook.Worksheets.PrintOut From:=1, To:=250,
Copies:=1, Collate:=True
End If

If PageCount = 250 Then
ActiveWorkbook.Worksheets.PrintOut From:=1, To:=250,
Copies:=1, Collate:=True
ActiveWorkbook.Worksheets.PrintOut From:=251, To:=500,
Copies:=1, Collate:=True
End If

and so on...

I know that my error has to be with not grasping the difference
between a Chart and a Worksheet, but I'm stuck.

Any help would be appreciated!

~Arawn




Arawn

Printing an entire workbook from VB
 
Thanks!!

::sigh:: It's always the little things...

~arawn


All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com