Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Starting Auto_Close macro based on an IF statement | Excel Discussion (Misc queries) | |||
Auto_Close | Excel Programming |