Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

lock out menus?

 
   Macintosh computer (Home) -> Excel RSS
Next:  Excel RTD (real-time data) for Excel X  
Author Message
Laphan

External


Since: Jun 22, 2004
Posts: 9



(Msg. 1) Posted: Thu Dec 18, 2003 10:38 pm
Post subject: lock out menus?
Archived from groups: microsoft>public>excel>programming, others (more info?)

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

 >> Stay informed about: lock out menus? 
Back to top
Login to vote
J.E. McGimpsey

External


Since: Dec 25, 2003
Posts: 551



(Msg. 2) Posted: Thu Dec 18, 2003 10:38 pm
Post subject: Re: lock out menus? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <3fe1ffe6_3 DeleteThis @127.0.0.1>,
"Laphan" <news DeleteThis @DoNotEmailMe.co.uk> 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<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: lock out menus? 
Back to top
Login to vote
Laphan

External


Since: Jun 22, 2004
Posts: 9



(Msg. 3) Posted: Sat Dec 20, 2003 12:27 am
Post subject: Re: lock out menus? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Many thanks JE


J.E. McGimpsey <jemcgimpsey.TakeThisOut@mvps.org> wrote in message
news:jemcgimpsey-608D28.12464018122003@msnews.microsoft.com...
In article <3fe1ffe6_3.TakeThisOut@127.0.0.1>,
"Laphan" <news.TakeThisOut@DoNotEmailMe.co.uk> 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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: lock out menus? 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> Excel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]