Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I feel like this should be obvious, but I'm missing something. I want to print specific worksheets in an Excel workbook (ie, sheets 1 through 7 of a 13 sheet book). I want them to go out as one print job, not 7 separate print jobs. I tried "selecting" sheets one through seven, but all the other sheets default to "selected" when I open the workbook, so the print job always prints all 13 sheets (code below). I havent found a way to "unselect" sheets (setting the select property to false give me an error). Any help would be much appreciated. Thanks. ECD Dim xlApp As New Microsoft.Office.Interop.Excel.Application Dim xlBook As Microsoft.Office.Interop.Excel.Workbook Dim SelectedSheets(6) As Integer 'Open excel sheet, load data xlBook = CType(xlApp.Workbooks.Add, _ Microsoft.Office.Interop.Excel.Workbook) xlBook = OpenExcelWorkBook(xlApp) SelectedSheets(0) = 1 SelectedSheets(1) = 2 SelectedSheets(2) = 3 SelectedSheets(3) = 4 SelectedSheets(4) = 5 SelectedSheets(5) = 6 SelectedSheets(6) = 7 xlBook.Sheets(SelectedSheets).Select() xlBook.PrintOut() xlBook.Close(False) xlBook = Nothing xlApp.Quit() xlApp = Nothing |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - printing specific areas | Excel Discussion (Misc queries) | |||
Printing Excel Worksheets | Excel Discussion (Misc queries) | |||
Limit Printing on specific worksheets in Excel | Excel Discussion (Misc queries) | |||
Printing Specific data from Excel worksheet | Excel Discussion (Misc queries) | |||
printing worksheets in Excel | Excel Discussion (Misc queries) |