I made a userform with two buttons (cancel and printpreview).
this seemed to work ok for me:
Option Explicit
Private Sub CommandButton1_Click()
Application.Visible = True
Unload Me
End Sub
Private Sub CommandButton2_Click()
Me.Hide
Application.Visible = True
Worksheets("sheet1").PrintPreview
Application.Visible = False
Me.Show
End Sub
Private Sub UserForm_Initialize()
Application.Visible = False
End Sub
Personal opinion only: I don't like hiding the excel application window. That
just means that there's something else (usually unrelated) shown in the
background. (I don't have many forms that should fill the whole screen,
either.)
JulieD wrote:
Hi
i'm having problems hiding / displaying the excel application window. What
i would like to do is have the application window hidden on open of the
workbook and display a useform (can do) , unhide it when i need to show a
report in print preview (can do) however i then need to hide it again (and
display the userform) when they either print the report or close the print
preview window - can't do.
any ideas?
also any general pros & cons about hiding the application window?
Regards
JulieD
--
Dave Peterson