Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default hiding / displaying the excel application window

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default hiding / displaying the excel application window

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default hiding / displaying the excel application window

Suggest also making it visible in the terminate event, just for proofing.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Dave Peterson" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I open a new window for each excel application? Kris New Users to Excel 2 February 21st 06 09:59 PM
How to set Excel to open a new window for each application Luke Excel Discussion (Misc queries) 1 September 28th 05 11:50 PM
Displaying MS Excel Chart control in ASP.NET Application oursmp Charts and Charting in Excel 0 April 20th 05 04:17 PM
How do I set up Excel to open a new instance/application window w. DK9144 Excel Discussion (Misc queries) 1 February 21st 05 04:34 PM
Displaying Excel chart in C# application JT[_4_] Excel Programming 1 July 18th 04 04:19 AM


All times are GMT +1. The time now is 01:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"