In Excel 2007, have a button that triggers a macro, which selects a few sheets out of many and sends to Application.Dialogs(xlDialogPrint).Show. As part of selecting the few sheets there are other macros triggered like showing certain rows, password protecting and unprotect-ing, etc.
It prints and cancels fine, except when users click the 'print preview' button in that printer dialog box. It shows the printer dialog fine, but no matter if they hit print or close it crashes.
It appears to run through the whole macro a second time and crashes because expected values and settings are not in place like normal when it runs through the first time.
Any way to account or or capture the print preview dialog stuff when print preview is launched via the printer dialog from Application.Dialogs(xlDialogPrint).Show?
I have tried changing passed parameters like
Application.Dialogs(xlDialogPrint).Show ,,,,,False
Application.Dialogs(xlDialogPrint).Show Arg6:=False
But these are not working; I've read that you can't alter the dialog anyway.
(Hope this is clear)