Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sub-menus of main menus for Excel 2007 | New Users to Excel | |||
Excel 2007 vs 2003 menus. | Excel Worksheet Functions | |||
Excel 2007 menus - how can I get rid of them? | New Users to Excel | |||
EXCEL 2007 Menus | Excel Discussion (Misc queries) | |||
Customizing Menus in Excel 2007 | Excel Discussion (Misc queries) |