+ Reply to Thread
Results 1 to 10 of 10

Broken macro button in Excel 2016

  1. #1
    Registered User
    Join Date
    06-06-2019
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    2010
    Posts
    4

    Broken macro button in Excel 2016

    I have a macro assigned to a button in Excel 2010 that works just fine. After upgrading to Excel 2016, the macro button causes it to jump to another worksheet in the workbook called "Approved Lenders and Banks" that I don't call out in the code, then doesn't complete the operation. The code works properly when I manually run it in VBA, it just doesn't work correctly when I use the button. I can't troubleshoot in VBA since it works properly if I go line by line there, so I'm not sure where the problem is occurring. It's extensive code so I attached it. Please let me know if there is a solution to this problem. Thanks!
    Attached Files Attached Files
    Last edited by kc3475; 10-09-2019 at 02:40 PM. Reason: Clarifying the issue

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Macro associated with Forms button worked in Excel 2010, not functioning properly in 2

    .
    Have you tried deleting the existing button ... save then close the workbook.

    Perhaps even re-boot your computer after that.

    Then re-open the workbook and create a new button attached to the macro ?


    Ya .. sounds crazy but .. Excel can run you crazy some times.

  3. #3
    Registered User
    Join Date
    06-06-2019
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    2010
    Posts
    4
    Quote Originally Posted by Logit View Post
    .
    Have you tried deleting the existing button ... save then close the workbook.

    Perhaps even re-boot your computer after that.

    Then re-open the workbook and create a new button attached to the macro ?




    Ya .. sounds crazy but .. Excel can run you crazy some times.

    Thanks for the suggestion! Unfortunately it didn’t work. I have other form buttons that do work, do I’m not sure what it is about this code that’s causing the problem.

  4. #4
    Registered User
    Join Date
    06-06-2019
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro associated with Forms button worked in Excel 2010, not functioning properly in 2

    Thanks for the suggestion! Unfortunately it didn’t work. I have other form buttons that do work, do I’m not sure what it is about this code that’s causing the problem.

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

    Re: Macro associated with Forms button worked in Excel 2010, not functioning properly in 2

    Administrative Note:

    Please don't quote entire posts unnecessarily. They are just clutter and make threads hard to read.
    Use the "Quick reply" instead
    Thanks

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Macro associated with Forms button worked in Excel 2010, not functioning properly in 2

    .
    Sorry it didn't work. Not certain what to advise.

  7. #7
    Registered User
    Join Date
    02-21-2019
    Location
    Tennessee, USA
    MS-Off Ver
    2013,2016,2019
    Posts
    2

    Re: Broken macro button in Excel 2016

    You said it works fine from in code but only has an issue when you operate the button .. my first thought is you haven't told the procedure what sheet it is supposed to be on .. the code you provided mentions 2 sheets 'Hide' and 'Main' and you mention this other sheet 'Approved Lenders and Banks' Upon, examining your code in Calculate the first time you 'Select' a sheet is in the conditionals of 'Rate Checker' and/or 'NW Check' but you have code prior to these sections that leave the location in an ambiguous state for example ..when referencing cell locations like in this case 'Clear Textboxs for PHJ and UW Text OutputRange("AJ27:BO34").Value = "" just before clearing this range you do the following ActiveSheet.uprotect "PF2018"Sheets("Hide").visible sheet it is not clear to me which sheet is supposed to have the Range("AJ27:BO34").Value set to "" is it the 'Main' sheet the 'Hide' sheet or is it some other sheet that was the active sheet when you pushed the button?
    Hopefully establishing the location in a 'clear' fashion will clear up your issue.

  8. #8
    Registered User
    Join Date
    06-06-2019
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    2010
    Posts
    4

    Re: Broken macro button in Excel 2016

    Thank you, I think that may have been part of the problem. I was able to find an earlier version of the spreadsheet that functions in 2016 and determine it is the line that makes the “Hide” sheet visible that was causing the problem. Just removed these lines and now it works.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Broken macro button in Excel 2016

    .
    Glad you located the issue.

    Cheers !

  10. #10
    Registered User
    Join Date
    02-21-2019
    Location
    Tennessee, USA
    MS-Off Ver
    2013,2016,2019
    Posts
    2

    Re: Broken macro button in Excel 2016

    Happy to see all those hours of chasing down my own issues helped someone.

+ 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. 2010 Macro not working in 2016 Excel
    By porepiga in forum Excel General
    Replies: 7
    Last Post: 04-18-2017, 12:11 PM
  2. Replies: 2
    Last Post: 03-26-2017, 01:49 PM
  3. Replies: 1
    Last Post: 06-08-2015, 03:15 PM
  4. Replies: 0
    Last Post: 06-08-2015, 03:07 PM
  5. Save Excel 2010 Form as an Interactive Web Page - With Functioning Macro?
    By Herman Merman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2014, 12:15 PM
  6. [SOLVED] Recorded Macro not functioning properly
    By Trevasaurus in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-30-2013, 11:01 AM
  7. [SOLVED] Excel 98 not functioning properly on formula
    By Michael Smith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2005, 09:05 PM

Tags for this Thread

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