+ Reply to Thread
Results 1 to 2 of 2

VBA switches sheets running in excel 2019 v 2010+2007+2011 for MAC, where it does not

  1. #1
    Registered User
    Join Date
    07-20-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    43

    VBA switches sheets running in excel 2019 v 2010+2007+2011 for MAC, where it does not

    I have some vba code to protect and unprotect the sheets in my workbook. This code runs fine (IE as expected) on Excel for Windows 2007, 2010 and Excel for MAC 2011 but in Excel for Windows 2019 it switches sheets when run.

    The Workbook has 6 sheets and the code below runs from a button on Sheet6;
    Please Login or Register  to view this content.
    What happens normally (on 2007,2010 & 2011 for MAC) is that after running the code, the button text changes and we are still on the sheet with the button (sheet6); in 2019, the code runs but we are then on Sheet5.

    Call S_Off and Call S_On call code like this;
    Please Login or Register  to view this content.
    But commenting those calls out makes NO difference to the result.

    The button that calls the ‘Unprotect code looks like this;
    Please Login or Register  to view this content.
    So it calls Protection_Off if Sheet4 is currently protected, or Protection_On if Sheet4 is not currently protected allowing the protection status to be toggled on and off based on the status of Sheet4; I only add this explanation for completeness, I don’t think it has anything to do with the problem.

    When the call to Protection_On is made, the problem of switching sheets does NOT happen.

    I have tested commenting out all other code except turning the Protection_Off and the problem persists.

    Any ideas on why the difference most welcome.

    Thanks
    Last edited by Ramses505; 04-28-2019 at 12:12 PM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Problem VBA in excel 2019 v 2010 (and 2007 and 2011 for MAC)

    Title much more descriptive now. Thank you for changing it
    Last edited by Pepe Le Mokko; 04-29-2019 at 02:54 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA 2010 / VBA 2011 search/find function won't work in 2011 (MAC)
    By lafanker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2014, 09:02 AM
  2. [SOLVED] Problem when changing Macro from Excel 2007 (Windows) to Excel 2011 (Mac)
    By TrialandError80 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 01-02-2014, 07:26 AM
  3. Problem with links going from Excel 2007 to 2010
    By gradmeg in forum Excel General
    Replies: 1
    Last Post: 12-06-2012, 06:44 PM
  4. Replies: 1
    Last Post: 05-16-2012, 09:57 PM
  5. Problem saving macro Excel 2007/2010
    By Gio_it in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2011, 06:08 AM
  6. Excel 2010 vs. Excel 2007 efficiency problem
    By Orson100 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-07-2010, 06:21 PM
  7. Excel 2007 to 2010 version problem
    By Gundersen in forum Excel General
    Replies: 0
    Last Post: 03-31-2010, 09:01 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1