Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.mac.office.excel
external usenet poster
 
Posts: 25
Default lock out menus?

Hi All

I want to create a VBA/SQL report in Excel, which I will sort out, but once
I have done this I'd like to lock out either the Data menu or preferably
just the External Data and Macro menus. Is this possible in Excel 2000 on
PC and Excel 98/2001 for Mac??

Thanks

Laphan




  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.mac.office.excel
external usenet poster
 
Posts: 493
Default lock out menus?

In article ,
"Laphan" wrote:

Hi All

I want to create a VBA/SQL report in Excel, which I will sort out, but once
I have done this I'd like to lock out either the Data menu or preferably
just the External Data and Macro menus. Is this possible in Excel 2000 on
PC and Excel 98/2001 for Mac??


One way:

To initially disable (put in a regular code module):

Public Sub DisableMenuItems()
With Application.CommandBars("Worksheet Menu Bar")
.Controls("Tools").Controls("Macro").Enabled = False
.Controls("Data").Controls( _
"Get External Data").Enabled = False
End With
End Sub

However, I would trash your application if you disabled those menus
for any other workbooks I may have open, so please put these in the
ThisWorkbook code module of your workbook:

Private Sub Workbook_Activate()
With Application.CommandBars("Worksheet Menu Bar")
.Controls("Tools").Controls("Macro").Enabled = False
.Controls("Data").Controls( _
"Get External Data").Enabled = False
End With
End Sub

Private Sub Workbook_Deactivate()
With Application.CommandBars("Worksheet Menu Bar")
.Controls("Tools").Controls("Macro").Enabled = True
.Controls("Data").Controls( _
"Get External Data").Enabled = True
End With
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
Sub-menus of main menus for Excel 2007 Eleanor Peppard New Users to Excel 1 March 16th 10 04:12 PM
how do I undo the scroll lock, thscroll lock button does not work scroll lock Excel Discussion (Misc queries) 3 July 19th 08 10:17 PM
Lock drop down menus Bonnie Excel Discussion (Misc queries) 1 December 17th 07 07:27 PM
difference between word 2003 menus and word 2007 menus-Explain pl kali Excel Discussion (Misc queries) 1 August 29th 07 07:56 AM
New Menus - attaching but menus are reset Greegan Excel Worksheet Functions 0 November 5th 05 03:19 PM


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