Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Printing excel docs from VBA

Hi,

I need to print Excel workbooks from an Access vba application, and
usually this works without any troubles. In some cases though, when
running

oExcel.Application.ActiveWorkbook.WorkSheets(arr). PrintOut

where the array contains the names of all visible sheets in the
workbook, some of the sheets don't print. I've checked that the names
are correct in the array. I've also tried different functions like
ActiveWorkbook.Printout, ActiveWindow.SelectedSheets.Printout (when I
know that all the sheets are selected) etc

For some reason som of the sheets don't print. If I open the excel doc
manually and prints the workbook then every visible sheet is printed.

Does anyone have any idea what can be done to avoid this, or is it
something done in the creation of the Excel docs perhaps? (Can't really
do much about that. We have around 60 people all over Europe creating
these documents)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Printing excel docs from VBA

If you braek it up do they all print

Dim WS as worksheet
for each ws in oExcel.Application.ActiveWorkbook.WorkSheets(arr)
ws.printout
next

NickHK

wrote in message
oups.com...
Hi,

I need to print Excel workbooks from an Access vba application, and
usually this works without any troubles. In some cases though, when
running

oExcel.Application.ActiveWorkbook.WorkSheets(arr). PrintOut

where the array contains the names of all visible sheets in the
workbook, some of the sheets don't print. I've checked that the names
are correct in the array. I've also tried different functions like
ActiveWorkbook.Printout, ActiveWindow.SelectedSheets.Printout (when I
know that all the sheets are selected) etc

For some reason som of the sheets don't print. If I open the excel doc
manually and prints the workbook then every visible sheet is printed.

Does anyone have any idea what can be done to avoid this, or is it
something done in the creation of the Excel docs perhaps? (Can't really
do much about that. We have around 60 people all over Europe creating
these documents)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Printing excel docs from VBA

Yes they all print then, but that doesn't solve my problem. The thing
is that I print these sheets through a pdf converter and if I print
each sheet independently I suddenly have the same number of pdfs as
there are sheets in the Excel document. This would leave me with the
task to try and merge heaps of pdfs into one to upload the completed
final document to the server.

Is this a bug in the PrintOut function that it sometimes skips certain
sheets when printing a compelte workbook?

Vegard

NickHK wrote:
If you braek it up do they all print

Dim WS as worksheet
for each ws in oExcel.Application.ActiveWorkbook.WorkSheets(arr)
ws.printout
next

NickHK

wrote in message
oups.com...
Hi,

I need to print Excel workbooks from an Access vba application, and
usually this works without any troubles. In some cases though, when
running

oExcel.Application.ActiveWorkbook.WorkSheets(arr). PrintOut

where the array contains the names of all visible sheets in the
workbook, some of the sheets don't print. I've checked that the names
are correct in the array. I've also tried different functions like
ActiveWorkbook.Printout, ActiveWindow.SelectedSheets.Printout (when I
know that all the sheets are selected) etc

For some reason som of the sheets don't print. If I open the excel doc
manually and prints the workbook then every visible sheet is printed.

Does anyone have any idea what can be done to avoid this, or is it
something done in the creation of the Excel docs perhaps? (Can't really
do much about that. We have around 60 people all over Europe creating
these documents)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Printing excel docs from VBA

Hi again,

I found that the pdf converter we use had a nifty append function to
merge pdfs so the solution from NickHK was what I went for. Thanks for
your input!

Vegard

wrote:
Yes they all print then, but that doesn't solve my problem. The thing
is that I print these sheets through a pdf converter and if I print
each sheet independently I suddenly have the same number of pdfs as
there are sheets in the Excel document. This would leave me with the
task to try and merge heaps of pdfs into one to upload the completed
final document to the server.

Is this a bug in the PrintOut function that it sometimes skips certain
sheets when printing a compelte workbook?

Vegard

NickHK wrote:
If you braek it up do they all print

Dim WS as worksheet
for each ws in oExcel.Application.ActiveWorkbook.WorkSheets(arr)
ws.printout
next

NickHK

wrote in message
oups.com...
Hi,

I need to print Excel workbooks from an Access vba application, and
usually this works without any troubles. In some cases though, when
running

oExcel.Application.ActiveWorkbook.WorkSheets(arr). PrintOut

where the array contains the names of all visible sheets in the
workbook, some of the sheets don't print. I've checked that the names
are correct in the array. I've also tried different functions like
ActiveWorkbook.Printout, ActiveWindow.SelectedSheets.Printout (when I
know that all the sheets are selected) etc

For some reason som of the sheets don't print. If I open the excel doc
manually and prints the workbook then every visible sheet is printed.

Does anyone have any idea what can be done to avoid this, or is it
something done in the creation of the Excel docs perhaps? (Can't really
do much about that. We have around 60 people all over Europe creating
these documents)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing file names on docs nan Excel Discussion (Misc queries) 2 December 1st 08 09:10 PM
Printing Embedded Word Docs JLMHoss Excel Discussion (Misc queries) 0 July 23rd 08 01:33 PM
Docs printing smaller than print preview now that 2007 installed j9 Excel Discussion (Misc queries) 0 March 5th 07 05:21 PM
Embedding Word Docs into Excel Worksheets and Then Printing The Word Docs mr_melvis Excel Worksheet Functions 1 April 8th 05 03:00 AM
converting excel docs to word docs rolercster New Users to Excel 2 January 4th 05 07:11 PM


All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"