Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Menus in Excel 2007

Not sure if this is the correct group but...
This proc in E 2003 no longer does what is required in E 2007 and only gets
by because of 'On Error Resume Next':

Sub DisableMenus()

'''Disable 'Sheet' menus
On Error Resume Next

'''Insert Worksheet
Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=852,
Recursive:=True).Enabled = False

With Application.CommandBars("Edit")
.Controls("Delete Sheet").Enabled = False
.Controls("Move or Copy Sheet...").Enabled = False
End With

Application.CommandBars("Ply").Enabled = False

On Error GoTo 0

End Sub

Does anyone have an idea how to convert?

Geoff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Menus in Excel 2007

I commented out On Error Resume Next and ran it in Excel 2007. It ran fine
for me and took all the programmed actions. Then I changed all the False's
to True and restored everything. So I don't think the problem is
necessarily xl2007 itself. Are you using smart menus? I don't, but if you
do, they might be problematic if the items are not visible - I can't say for
sure because I haven't tested it.

--
Regards,
Tom Ogilvy


"Geoff" wrote:

Not sure if this is the correct group but...
This proc in E 2003 no longer does what is required in E 2007 and only gets
by because of 'On Error Resume Next':

Sub DisableMenus()

'''Disable 'Sheet' menus
On Error Resume Next

'''Insert Worksheet
Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=852,
Recursive:=True).Enabled = False

With Application.CommandBars("Edit")
.Controls("Delete Sheet").Enabled = False
.Controls("Move or Copy Sheet...").Enabled = False
End With

Application.CommandBars("Ply").Enabled = False

On Error GoTo 0

End Sub

Does anyone have an idea how to convert?

Geoff

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Menus in Excel 2007

That's odd - I wonder how the wbooks may differ. I run this as part of an
add-in where I discourage people trying to meddle by inserting or deleting
sheets. In particular, with Application.CommandBars("Ply").Enabled = False I
am, as you can tell, trying to disable right clicking on the sheet tabs.
This used to work ok but now in 2007 i can right click away without
restriction and i wondered if maybe menu titles had been changed.

Geoff

"Tom Ogilvy" wrote:

I commented out On Error Resume Next and ran it in Excel 2007. It ran fine
for me and took all the programmed actions. Then I changed all the False's
to True and restored everything. So I don't think the problem is
necessarily xl2007 itself. Are you using smart menus? I don't, but if you
do, they might be problematic if the items are not visible - I can't say for
sure because I haven't tested it.

--
Regards,
Tom Ogilvy


"Geoff" wrote:

Not sure if this is the correct group but...
This proc in E 2003 no longer does what is required in E 2007 and only gets
by because of 'On Error Resume Next':

Sub DisableMenus()

'''Disable 'Sheet' menus
On Error Resume Next

'''Insert Worksheet
Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=852,
Recursive:=True).Enabled = False

With Application.CommandBars("Edit")
.Controls("Delete Sheet").Enabled = False
.Controls("Move or Copy Sheet...").Enabled = False
End With

Application.CommandBars("Ply").Enabled = False

On Error GoTo 0

End Sub

Does anyone have an idea how to convert?

Geoff

  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Menus in Excel 2007

Hi Geoff,

I gave this a try with the most recent internal builds of Excel and it works
fine, even without the On Error Resume Next. Of course, with Excel 2007,
there are a few new entry points to these commands on the ribbon, etc. that
are not disabled by your code but the entry points that I'd expect to be
affected by your code were.

If you're still seeing any issues, I'd ask you to try this in B2TR and let
me know (directly via email) if there are problems.

Cheers,
Dan
Excel Team

Note: We've only got a couple weeks to get bugs filed and fixed, so if I've
requested additional info via email, it'd be great if you can get that to us
ASAP. Please include any necessary sample files, as well as detailed repro
steps so that we can try to reproduce the problem on our side. Also - if
you're emailing me directly (definitely the most efficient at this point)
you'll want to fixup my email address to remove everything after danbatt and
before the @.




"Geoff" wrote in message
...
That's odd - I wonder how the wbooks may differ. I run this as part of an
add-in where I discourage people trying to meddle by inserting or deleting
sheets. In particular, with Application.CommandBars("Ply").Enabled =
False I
am, as you can tell, trying to disable right clicking on the sheet tabs.
This used to work ok but now in 2007 i can right click away without
restriction and i wondered if maybe menu titles had been changed.

Geoff

"Tom Ogilvy" wrote:

I commented out On Error Resume Next and ran it in Excel 2007. It ran
fine
for me and took all the programmed actions. Then I changed all the
False's
to True and restored everything. So I don't think the problem is
necessarily xl2007 itself. Are you using smart menus? I don't, but if
you
do, they might be problematic if the items are not visible - I can't say
for
sure because I haven't tested it.

--
Regards,
Tom Ogilvy


"Geoff" wrote:

Not sure if this is the correct group but...
This proc in E 2003 no longer does what is required in E 2007 and only
gets
by because of 'On Error Resume Next':

Sub DisableMenus()

'''Disable 'Sheet' menus
On Error Resume Next

'''Insert Worksheet
Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=852,
Recursive:=True).Enabled = False

With Application.CommandBars("Edit")
.Controls("Delete Sheet").Enabled = False
.Controls("Move or Copy Sheet...").Enabled = False
End With

Application.CommandBars("Ply").Enabled = False

On Error GoTo 0

End Sub

Does anyone have an idea how to convert?

Geoff


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
Excel 2007 vs 2003 menus. Ted Stilwell Excel Worksheet Functions 3 February 7th 09 05:44 PM
Excel 2007 menus - how can I get rid of them? Vic Baron New Users to Excel 4 August 21st 08 04:15 PM
EXCEL 2007 Menus Marvin Buzz Excel Discussion (Misc queries) 1 May 22nd 08 04:39 PM
Customizing Menus in Excel 2007 Loris Excel Discussion (Misc queries) 1 February 11th 08 10:52 PM


All times are GMT +1. The time now is 05:45 PM.

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"