LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Hide the close X in excel

Hi,

I have a code, (below), to hide toolbars and to prevent users from
tampering. I have a macro which performs some operations and then saves and
closes the file. I have just realised that the X to close excel on the top
right corner is still visible meaning the file can be closed without using
the macro. Is it possible to also hide this feature so users must close
using the macro?

Thanks

Private mFormulaBar

Private Sub Workbook_BeforeClose()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
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
Before Close Event Hide all Worksheets then Close Application RyanH Excel Programming 0 January 24th 08 03:15 PM
Hide Close Button Excel 2007 [email protected] Excel Discussion (Misc queries) 0 May 31st 07 07:52 AM
how to close a form in vba (not hide) Pierre[_16_] Excel Programming 3 July 15th 05 06:01 PM
close (hide) toolbars Anthony Excel Discussion (Misc queries) 7 June 5th 05 03:19 PM
Hide all Excel tool/command bars except mine and reload on close Matt Jensen Excel Programming 2 December 20th 04 05:44 PM


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