Results 1 to 6 of 6

Thread: Disable controls in later versions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Location
    U.K.
    Posts
    65

    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

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Disable controls in later versions

    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  4. #4
    Fanatic Member dmaruca's Avatar
    Join Date
    May 2006
    Location
    Jacksonville, FL
    Posts
    577

    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Location
    U.K.
    Posts
    65

    Re: Disable controls in later versions

    Quote Originally Posted by westconn1 View Post
    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 View Post
    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

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width