Disable Ribbon command while WB is excel 2003 format

J

JohnEd

In the forums, I'm Ron de Bruin's instructions on changing the Ribbon
in Excel 2007. I haven't tried any of this yet, but it appears that
the WB needs to be in Excel 2007 format. But because some of the uses
of my WB are still on Excel 2003, I need the WB in that format.

So, How do I disable, say the 'Cut' control/or command in the
Clipboard Group when the WB is in Excel2003?

Thanks,
John
 
G

GS

JohnEd explained :
In the forums, I'm Ron de Bruin's instructions on changing the Ribbon
in Excel 2007. I haven't tried any of this yet, but it appears that
the WB needs to be in Excel 2007 format. But because some of the uses
of my WB are still on Excel 2003, I need the WB in that format.

So, How do I disable, say the 'Cut' control/or command in the
Clipboard Group when the WB is in Excel2003?

Thanks,
John

AFAIK, you need to have two versions of your workbook. One for pre-2007
and one with the xml component for 2007 and later.

Otherwise, a COMAddin can be configured to allow use of any version
workbook and still set up your ribbon customizations.

Similarly, you could just include code to open a dummy 2007.xlsm or
2007.xlsa that sets the ribbon up while your 2003.xls is open. You can
include version-aware code in your 2003.xls to open the 2007 file if
the Excel version is >=12. This will allow your early version file to
work in all versions as desired, without having to maintain two
separate versions.

Example: (2003.xls)
In your Workbook_Open event or Auto_Open procedure

If Application.Version >= 12 Then
Workbooks(ThisWorkbook.Path &"\ribbon.xlsa").Open
End If

In your Workbook_Close event or Auto_Close procedure:

On Error Resume Next
Workbooks("ribbon.xlsa").Close False

Note that the only purpose the 2007 file serves is to set up the ribbon
how you want it. This will require using the CustomUI editor as
outlined in Ron's documentation.

Also, Bob Philips has an excellent alternative solution here:

http://msmvps.com/blogs/xldynamic/archive/2010/03/27/deploy-me-simple.aspx

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top