Disable controls in later versions
I have a scenario where a 2003 workbook disables certain controls within it's environments (thinks like the save, save as, page setup etc). This works perfect but the company I work for has decided to roll out Office 2010 over a period of time.
This isn't so much of a problem except for it is being done in phases. This is a problem as there will be a strong possibility that both 2003 and 2010 users will need to use the same spreadsheet at the same time.
I have written some code already that checks which version of office is installed and depending on the result, runs the required code (which worked great for sending emails) but the problem I have is with 2010 menu controls.
I cant install any 3rd party add-ons and all of the code I have found so far requires the workbook to be saved in a 2010 format which is not possible.
Is there a way I could write the code to disable 2010 controls from a 2003 workbook please? I have access to 2010 as Im currently piloting it if that makes life any easier?
Any solutions will get a virtual high five and muchos respect.
Kind regards,
Mav
Re: Disable controls in later versions
i don't have 2010, so these are only suggestions
try recording a macro in 2010, then adapt that code to your requirement, and run dependent on version that opens the workbook
Re: Disable controls in later versions
Re: Disable controls in later versions
koolsid is right. as of 2007 the commandbars object doesn't do any good. your code will need to be modified to use the new ribbon interface.
Re: Disable controls in later versions
Quote:
Originally Posted by
westconn1
i don't have 2010, so these are only suggestions
try recording a macro in 2010, then adapt that code to your requirement, and run dependent on version that opens the workbook
I did. Unfortunately, 2010 decided it couldn't record that particular method (right clicking of menus etc) and returned nothing.
Quote:
Originally Posted by
koolsid
I did have a look at this but it fell at the first line. The problem is Dim myribbon As IRibbonUI errors because 2003 doesn't understand IRibbonUI.
I have a funny feeling this isn't going to be possible as I need to be able to use later references than 2003 has. Looks like Im going to have to convert all my spreadsheets and make a backup and when Office 2010 goes live, switch them over :(
Re: Disable controls in later versions
Try creating an Excel file in 2010 instead of 2003 and then save it as 2003? Also use the code that you mentioned in post 1 regarding version checking...
Sid