LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dim dim is offline
external usenet poster
 
Posts: 123
Default MAJOR PROBLEM! --- Menu Bars don't unhide?

Hi folks.

I have code in my auto_open macro to hide all the excel toolbars and menu
bars to give a clean dictator program appearance.
I also have included in the auto_close macro the code to re-show these menu
bars. All works fine generally....however...

......some people have been having problems with Excel 2003 if the program is
not shut-down correctly. When they start up Excel (Not my workbook program)
again, the menu bars are still hidden.

I believed that executing my program, and then exiting it again correctly
would fix this, because the auto_close macro would have the opportunity to
show the menus again, but I've been told it doesn't!

I created a basic workbook file with two buttons, one to show and one to
hide the menus. Using this seemingly works fine to retrieve the menu bars.

I've been having problems replicating this issue with Excel 2002. I've run
my program and ended Excel with the Windows Task Manager, and I've run it and
shut down my system cold with the on/off button, but the toolbars are always
there when I start back up.

Is there something about Excel 2003 that I'm missing?

Why does the auto_close macro not retrieve the hidden menu bar and toolbars
when the text of the auto_close code is the exact same as that within the
show/hide workbook?

Any advice is much appreciated. Thanks.

The code segments are as follows:

Sub Auto_open()

If Val(Application.Version) < 9 Then
MsgBox " Program Requires Microsoft Excel 2002 or Newer ", vbOKOnly
+ vbExclamation, "ERROR"
ActiveWorkbook.Save
Application.Quit
End If

If Val(Application.Version) = 9 Then
Response = MsgBox("Program Has Not Been Tested Below Microsoft Excel
2002 - Start Anyway? ", vbYesNo + vbQuestion, "ERROR")
End If
If Response = vbNo Then
ActiveWorkbook.Save
Application.Quit
End If

Application.WindowState = xlMaximized
Application.ShowWindowsInTaskbar = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False
Application.IgnoreRemoteRequests = True
Application.EnableCancelKey = xlDisable
With ActiveWindow
Application.Caption = "My Program"
.DisplayGridlines = False
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
.Zoom = 100
End With
With Application
.DisplayFormulaBar = False
.DisplayStatusBar = False
End With
Application.AutoRecover.Enabled = False
ActiveWorkbook.EnableAutoRecover = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Forms").Visible = False
Application.CommandBars("Borders").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Control Toolbox").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("Exit Design Mode").Visible = False
Application.CommandBars("External Data").Visible = False
Application.CommandBars("Formula Auditing").Visible = False
Application.CommandBars("Picture").Visible = False
Application.CommandBars("PivotTable").Visible = False
Application.CommandBars("Protection").Visible = False
Application.CommandBars("Reviewing").Visible = False
Application.CommandBars("Text To Speech").Visible = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Watch Window").Visible = False
Application.CommandBars("Web").Visible = False
Application.CommandBars("WordArt").Visible = False
End Sub

Sub Auto_close()
'
' Auto_close Macro
' Macro recorded 10/12/2007
'
'
Workbooks("MyProgram").Activate
ActiveWorkbook.Save
Application.ShowWindowsInTaskbar = True
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.IgnoreRemoteRequests = False
Application.EnableCancelKey = xlInterrupt
Sheets("Sheet1").Select
With ActiveWindow
.DisplayGridlines = True
.DisplayHeadings = True
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
End With
With Application
.DisplayFormulaBar = True
.DisplayStatusBar = True
End With
Application.AutoRecover.Enabled = True
ActiveWorkbook.EnableAutoRecover = True
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
Application.Caption = Empty
Application.WindowState = xlNormal
Application.Quit

End Sub

 
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
Working with Menu Bars / Toolbars problem Alex Excel Programming 4 March 16th 06 10:47 PM
Lost all my menu bars and tool bars CathyJ Excel Discussion (Misc queries) 3 August 8th 05 12:49 PM
Major linking problem tamxwell Excel Programming 0 June 30th 05 05:40 PM
New Menu on Worksheet & Chart Menu Bars Juan[_3_] Excel Programming 2 May 21st 04 11:46 PM
linking chart menu bars and worksheet menu bars majikman[_8_] Excel Programming 0 May 10th 04 09:45 PM


All times are GMT +1. The time now is 01:50 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"