PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Charting Code problem

Reply

Code problem

 
Thread Tools Rate Thread
Old 20-11-2003, 05:52 PM   #1
Phil Hageman
Guest
 
Posts: n/a
Default Code problem


The below Auto_Close is suppose to restore the screen
display and workbook tabs (toolbars and tabs visible
again)when the user closes the window by clicking the "X"
button. Auto_Close doesn't work. Can someone help me with
the code? I have included the Auto_Open that turns off
full screen and tabs, in case it has something to do with
why Auto_Close doesn't work.

Sub Auto_Open()
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.DisplayFullScreen = True

For Each ws In Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
Application.GoTo ws.Range("A1"), True
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayWorkbookTabs = False
End If
Next

Worksheets("Scorecard").Select
ThisWorkbook.Colors(7) = RGB(255, 124, 128)

Application.AutoPercentEntry = True
Application.ScreenUpdating = True
End Sub


Sub Auto_Close()
ActiveWindow.DisplayFullScreen = True
ActiveWindow.DisplayWorkbookTabs = True
End Sub



  Reply With Quote
Old 20-11-2003, 08:55 PM   #2
Tushar Mehta
Guest
 
Posts: n/a
Default Re: Code problem

*What* doesn't work?

Auto_Open sets DisplayFullScreen to True and Auto_Close does the same
thing. So, there should be no visual change.

You are setting active window's DisplayWorkbookTabs to true. But, the
workbook is about to close. So, I don't know what should happen next.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <0db101c3af8f$11bc19b0$a501280a@phx.gbl>,
anonymous@discussions.microsoft.com says...
> The below Auto_Close is suppose to restore the screen
> display and workbook tabs (toolbars and tabs visible
> again)when the user closes the window by clicking the "X"
> button. Auto_Close doesn't work. Can someone help me with
> the code? I have included the Auto_Open that turns off
> full screen and tabs, in case it has something to do with
> why Auto_Close doesn't work.
>
> Sub Auto_Open()
> Dim ws As Worksheet
> Application.ScreenUpdating = False
> Application.DisplayFullScreen = True
>
> For Each ws In Worksheets
> If ws.Visible = xlSheetVisible Then
> ws.Select
> Application.GoTo ws.Range("A1"), True
> ActiveWindow.DisplayGridlines = False
> ActiveWindow.DisplayWorkbookTabs = False
> End If
> Next
>
> Worksheets("Scorecard").Select
> ThisWorkbook.Colors(7) = RGB(255, 124, 128)
>
> Application.AutoPercentEntry = True
> Application.ScreenUpdating = True
> End Sub
>
>
> Sub Auto_Close()
> ActiveWindow.DisplayFullScreen = True
> ActiveWindow.DisplayWorkbookTabs = True
> End Sub
>
>
>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off