PDA

View Full Version : Disable Print Preview in dialogue box



av8tordude
03-02-2011, 09:05 AM
When I call the print dialogue box via Application.Dialogs(xlDialogPrint).Show, clicking the print preview crashes my workbook. I google for a solution and came across this code...

Application.Dialogs(xlDialogPrint).Show (preview = False)

but it errors highlighting preview. I'm kindly looking for assistance for a solution this problem. Thanks

I'm currently using excel 2007, but I have other computers that have excel 2000 - 2010.

Rob342
03-12-2011, 07:22 AM
Try this, disables print preview from the main menu, but if you take the option to print you will still see it, unless you disable print.
ps dont forget to turn it back on !

Sub MenuControl_Enabled_False_2000_2003()' Excel 2000 - 2003
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=109)'print ID:=4
Ctrl.Enabled = False
Next Ctrl
End Sub


Rob