+ Reply to Thread
Results 1 to 2 of 2

Compile Error in Excel 2016 [not in 2013]

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-06-2015
    Location
    Leeds, England
    MS-Off Ver
    365 Version 2302 Build 16.0.16130.20942
    Posts
    130

    Compile Error in Excel 2016 [not in 2013]

    We have just moved over to 2016 from 2013 at work and I'm testing some of our excel based programs. There's a button on one sheet that runs off code to provide results which works fine. But if I create a module to call on the button_click I receive a compile error that the sub or function is not defined. These used to work in 2013. The button_click isn't a Private Sub.

    As it has sensitive coding in the button_click to our company I can't attached a spreadsheet. Has anyone come across this before and know how to get around it?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,762

    Re: Compile Error in Excel 2016

    This is very difficult to diagnose without at least seeing the code. There is nothing in 2016 that would cause this if it worked in 2013. Did you move from 32-bit to 64-bit office, or vice versa?

    What module contains sub button_click? What module contains the code that calls it? You said, "If I create a module...." instead of "There is a module...." That makes it sound like this code did not exist in the 2013 version, so what have you changed in the code besides just going from 2013 to 2016?

    One way to diagnose this type of problem is to make a copy of your file, and strip out everything that doesn't relate to the problem. Delete all the data in all the sheets except for the button. Delete all the code in all the modules except for the sub button_click and the other code that calls it. In sub button_click remove all the code and just leave
    MsgBox "button was clicked"
    After doing all that see if the problem still exists. If it does, then attach your file since it will not longer have any sensitive data or code.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Replies: 6
    Last Post: 03-31-2021, 04:24 PM
  2. [SOLVED] Excel Version Problem - Office 365 (2016) vs. 2013
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2018, 08:24 PM
  3. Pivot Table Macro - Debug Error: Created in 2016 and works, does not work in Excel 2013
    By ashley72788 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-05-2017, 04:07 AM
  4. Replies: 1
    Last Post: 04-01-2017, 04:53 AM
  5. Replies: 4
    Last Post: 03-30-2016, 11:30 AM
  6. Macro From Excel 2013 Not Working in 2016
    By tm1238 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2016, 04:39 PM
  7. Compile Error : Method or Data member not found (Excel 2013)
    By psingh409 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2015, 11:34 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