View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Peter-d Peter-d is offline
external usenet poster
 
Posts: 9
Default Multiple Worksheet Selection

Well, yeha, I'm essentially doing something like this...e xcept I took it one
step further where I hooked my own code instead of the standard print
function. The only thing, and thanks for pointing it out, is that in using
this line:
Application.Dialogs(xlDialogPrint).Show
in my code to actually invoke the menu, I didn't look at all options
available to the user and didn't think og the "entire workbook" option.

I could just use the PrintOut method, but I liked giving the user the dialog
in case they wanted to change printer and other properties.

I'll have to give this some more thought.

Thanks

"Dave Peterson" wrote:

I don't think you can ever know.

Inside the file|Print dialog, there's an option for "entire workbook".

I think the best you could do would be to disable the built in printing.

In the ThisWorkbook module.

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
MsgBox "Use the Buttons on each sheet!"
End Sub

Then provide the user with macros that print what you want.

Kind of...

Option explicit
sub testme()
'set up whatever you want
'turn off event handling, so your code can print
application.enableevents = false
'do your specific printing
'turn on events
application.enableevents = true
end sub


But all this fails if events are disabled--or macros are disabled.


Peter-d wrote:

Thanks Dave.

The ability to select different sheet in each window won't bother me. If you
look at my own reply, you will see that I just need to know before I print,
and since each window will handle their print selection individually, it
wan't matter.

But thatnks for the activewindow.selectedsheets tip.

"Dave Peterson" wrote:

msgbox activewindow.selectedsheets.count

You can select different sheets in each window, though.

Peter-d wrote:

Is there a way out there to figure out from VB code if more than one
worksheet is selected?

Thanks

--

Dave Peterson


--

Dave Peterson