excel 2007 vba Application.Dialogs(xlDialogPrint).Show crashes if user chooses print preview -


In Excel 2007, there is a button that triggers a macro, which selects several sheets and the application Sends to Dialogues (xlDialogPrint) .how. Some other rows, as a part of choosing some sheets, are password protected macros and look like insecure ING etc.

It is ok to print and cancel, except when users click on the 'print preview' button. The printer dialog box shows this printer dialog fine, but no matter if they press the print or It crashes.

It seems that the whole macro has to run a second time and it crashes because the expected value and settings are not as normal when it runs through the first time.

Any way to use the print preview dialog content or to print, when the print preview application is launched through the printer dialog. Dialog (xlDialogPrint). By the way?

I have tried to change the changing parameters from

  application.Dialogs (xlDialogPrint). Show ,,,, wrong application Dialog (xlDialogPrint). Arg6: = False  

but they are not working; I have read that you can not change the dialog anyway.

(Hopefully this is obvious)

Not sure if you print Whether or not to preview the click directly from the button Usually I use something like this, I find it easy to see the preview before, then decide whether I want to print a hard copy. But it can not work for your situation.

  Private commandbutton 1_Click () vSheets VSheets = Array ("Sheet1", "Sheet2") as ActiveWorkbook.Sheets (vSheets). 'Sheets should be selected Activebook. Print preview: = true 'print preview brings end sub  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -