Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Auto_Close() needs help

This sub is suppose run when the user closes the workbook -
it does not work. The two Auto_Close instructions are
reversals of instructions executed in "Sub Auto_Open()",
which run successfully when the workbook is opened. Both
instructions execute properly.

The expectation: when the user closes the workbook by
clicking on the "X" button, the screen display restores
the toolbars, and workbook tabs become visible.

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

Can someone help make this Sub work correctly?

Thanks, Phil

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Auto_Close() needs help

The problem is with this line
Application.DisplayWorkbookTabs = Tru

It should be
ActiveWindow.DisplayWorkbookTabs = Tru

Try again

----- Phil Hageman wrote: ----

This sub is suppose run when the user closes the workbook
it does not work. The two Auto_Close instructions are
reversals of instructions executed in "Sub Auto_Open()",
which run successfully when the workbook is opened. Both
instructions execute properly

The expectation: when the user closes the workbook by
clicking on the "X" button, the screen display restores
the toolbars, and workbook tabs become visible

Sub Auto_Close(
Application.DisplayFullScreen = Tru
Application.DisplayWorkbookTabs = Tru
End Su

Can someone help make this Sub work correctly

Thanks, Phi


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default More Detail

Edwin, I tried your code and ouldn't get it to work. For
a better picture, here ares both the Auto_Open and
Auto_Close Subs. With this can you sugges how to set up
the Auto_Close"? Also, if you have any clean-up
suggestions for Auto_Open I would appreciate it too.
Thanks, Phil

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
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








-----Original Message-----
The problem is with this line:
Application.DisplayWorkbookTabs = True

It should be:
ActiveWindow.DisplayWorkbookTabs = True

Try again.

----- Phil Hageman wrote: -----

This sub is suppose run when the user closes the

workbook -
it does not work. The two Auto_Close instructions

are
reversals of instructions executed in "Sub Auto_Open

()",
which run successfully when the workbook is opened.

Both
instructions execute properly.

The expectation: when the user closes the workbook

by
clicking on the "X" button, the screen display

restores
the toolbars, and workbook tabs become visible.

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

Can someone help make this Sub work correctly?

Thanks, Phil


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default More Detail

Try

Sub Auto_Open(
Dim ws As Workshee
Application.ScreenUpdating = Fals
Application.DisplayFullScreen = Tru

For Each ws In Worksheet
If ws.Visible = True The
ws.Activat
Range("A1").Selec
ActiveWindow.DisplayGridlines = Fals
End I
Nex

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

Application.AutoPercentEntry = Tru
End Su

Sub Auto_Close(
Dim ws As Workshee
Application.DisplayFullScreen = Fals
ActiveWindow.DisplayWorkbookTabs = Tru
For Each ws In Worksheet
If ws.Visible = True The
ws.Activat
Range("A1").Selec
ActiveWindow.DisplayGridlines = Tru
End I
Nex
Worksheets("Scorecard").Selec
End Sub
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
Starting Auto_Close macro based on an IF statement questor Excel Discussion (Misc queries) 4 February 25th 08 10:22 PM
Auto_Close Luc Benninger Excel Programming 2 October 14th 03 12:34 PM


All times are GMT +1. The time now is 01:13 AM.

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

About Us

"It's about Microsoft Excel"